
Added the DDS Texture Loading for future use Added the gamepad class for future use Added first child method to the scenegraph Added RGB to intensity and lerp methods to the shared methods class Added the terrain node class with normals Fixed issue with submeshnode not passing the world transform to the actual meshes
23 lines
653 B
C++
23 lines
653 B
C++
#include "SharedMethods.h"
|
|
|
|
XMMATRIX SharedMethods::RotateFromPoint(float x, float y, float z, XMMATRIX rotationMatrix)
|
|
{
|
|
// Translates a matrix to a point, rotates and then returns back to where it was
|
|
return XMMatrixTranslation(x, y, z) * rotationMatrix * XMMatrixTranslation(-x, -y, -z);
|
|
}
|
|
|
|
// Method so i can use normal RGB values and hopefully hex values too since im use to those
|
|
float SharedMethods::RGBValueToIntensity(int value)
|
|
{
|
|
return (float)value / 255.0f;
|
|
}
|
|
|
|
float SharedMethods::lerp(int a, int b, int p)
|
|
{
|
|
return lerp((float)a, (float)b, (float)p);
|
|
}
|
|
|
|
float SharedMethods::lerp(float a, float b, float p)
|
|
{
|
|
return a + p * (b - a);
|
|
} |