- Implemented KRBehavior class
- Imported animations now have the auto_play and loop flags set to false by default - Implemented Pre-Rotation, Post-Rotation, Scale Offset, Rotate Offset, Scale Pivot, and Rotate Pivot transform attributes. - Reduced use of euler angles, replacing them with Quaternions where possible - Fixed bug with incorrect Y rotation in KRMat4::rotate - Material / GL Context changes have been optimized to reduce redundant glUniform calls - New KRMesh format implemented, with support for importing BindPose matrices - Fixed bug that caused a duplicate "default_camera" node to be added rather than picking up an existing "default_camera" node imported from FBX. This enables animations to drive the camera correctly. - Implemented KRVector3::Scale - Implemented KRVector3::KRVector3(double *v);
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "KRShader.h"
|
||||
#include "KRContext.h"
|
||||
#include "KRMat4.h"
|
||||
#include "KRQuaternion.h"
|
||||
#include "assert.h"
|
||||
#include "KRStockGeometry.h"
|
||||
|
||||
@@ -30,20 +31,11 @@ std::string KRDirectionalLight::getElementName() {
|
||||
}
|
||||
|
||||
KRVector3 KRDirectionalLight::getWorldLightDirection() {
|
||||
KRVector3 world_rotation = getWorldRotation();
|
||||
KRVector3 light_rotation = KRVector3(0.0, 0.0, 1.0);
|
||||
|
||||
KRMat4 m;
|
||||
m.rotate(world_rotation.x, X_AXIS);
|
||||
m.rotate(world_rotation.y, Y_AXIS);
|
||||
m.rotate(world_rotation.z, Z_AXIS);
|
||||
|
||||
KRVector3 light_direction = KRMat4::Dot(m, light_rotation);
|
||||
return light_direction;
|
||||
return KRMat4::Dot(getWorldRotation().rotationMatrix(), getLocalLightDirection());
|
||||
}
|
||||
|
||||
KRVector3 KRDirectionalLight::getLocalLightDirection() {
|
||||
return KRVector3(0.0, 0.0, 1.0);
|
||||
return KRVector3::Forward();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user