diff --git a/CMakeLists.txt b/CMakeLists.txt index f6374f1..111e948 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,9 @@ if(BUILD_SAMPLES) add_executable(morphAnimationSample morphAnimationSample.cpp) target_link_libraries(morphAnimationSample ${LIB_NAME}) + add_executable(driverSample driverSample.cpp) + target_link_libraries(driverSample ${LIB_NAME}) + add_executable(lightSample lightSample.cpp) target_link_libraries(lightSample ${LIB_NAME}) diff --git a/bone.h b/bone.h index 1c6948e..cde0de6 100644 --- a/bone.h +++ b/bone.h @@ -10,7 +10,7 @@ namespace vb01{ class Bone : public Node{ public: - Bone(std::string, float, Vector3 = Vector3::VEC_ZERO, Quaternion = Quaternion::QUAT_W, Vector3 = Vector3::VEC_ZERO); + Bone(std::string, float, Vector3 = Vector3::VEC_ZERO, Quaternion = Quaternion::QUAT_W, Vector3 = Vector3::VEC_IJK); void setPosePos(Vector3 p); void setPoseRot(Quaternion r); void setPoseScale(Vector3 s); diff --git a/box.cpp b/box.cpp index c686e79..429089d 100755 --- a/box.cpp +++ b/box.cpp @@ -51,8 +51,8 @@ namespace vb01{ 4, 2, 2, 7, 2, 1, 3, 2, 0, 3, 2, 0, 0, 2, 3, 4, 2, 1, - 1, 4, 0, 5, 4, 1, 6, 4, 2, - 6, 4, 2, 2, 4, 3, 1, 4, 0, + 6, 4, 2, 5, 4, 1, 1, 4, 0, + 1, 4, 0, 2, 4, 3, 6, 4, 2, 2, 1, 2, 1, 1, 1, 0, 1, 0, 0, 1, 0, 3, 1, 3, 2, 1, 2, diff --git a/keyframeChannel.cpp b/keyframeChannel.cpp index dbfc242..eca1306 100644 --- a/keyframeChannel.cpp +++ b/keyframeChannel.cpp @@ -80,11 +80,23 @@ namespace vb01{ return keyframeChannel.keyframes[pastKeyframeId + (last ? 0 : 1)]; } - Keyframe KeyframeChannel::createKeyframe(KeyframeInterpolation interpolation, float value, float frame) { + Keyframe KeyframeChannel::createKeyframe( + KeyframeInterpolation interpolation, + float value, + float frame, + float leftHandleValue, + float leftHandleFrame, + float rightHandleValue, + float rightHandleFrame) + { Keyframe keyframe; keyframe.interpolation = interpolation; keyframe.frame = frame; keyframe.value = value; + keyframe.leftHandleValue = leftHandleValue; + keyframe.leftHandleFrame = leftHandleFrame; + keyframe.rightHandleValue = rightHandleValue; + keyframe.rightHandleFrame = rightHandleFrame; return keyframe; } diff --git a/keyframeChannel.h b/keyframeChannel.h index 4c6e098..72ab67d 100644 --- a/keyframeChannel.h +++ b/keyframeChannel.h @@ -67,7 +67,7 @@ namespace vb01{ static KeyframeChannel::Type getKeyframeChannelType(std::string); static float interpolate(Keyframe, Keyframe, float); static Keyframe findKeyframe(float, KeyframeChannel, bool); - static Keyframe createKeyframe(Keyframe::Interpolation, float, float); + static Keyframe createKeyframe(Keyframe::Interpolation, float, float, float = 0, float = 0, float = 0, float = 0); static KeyframeChannel createKeyframeChannel(KeyframeChannel::Type, Animatable*, std::vector); }; diff --git a/mesh.cpp b/mesh.cpp index a68afcc..e71c81a 100755 --- a/mesh.cpp +++ b/mesh.cpp @@ -128,6 +128,7 @@ namespace vb01{ if(node){ pos = node->localToGlobalPosition(Vector3::VEC_ZERO); orient = node->localToGlobalOrientation(Quaternion::QUAT_W); + scale = node->getScale(); camPos = cam->getPosition(); }