3: 2011-08-09 (火) 20:10:34 iseki |
4: 2011-09-16 (金) 13:04:37 iseki |
| *** 概要 [#pd1f2391] | | *** 概要 [#pd1f2391] |
| - SecondLife/OpenSim の内部用の最適化(バイナリ化)された [[BVH]] データ | | - SecondLife/OpenSim の内部用の最適化(バイナリ化)された [[BVH]] データ |
| + | - see llkeyframemotion.cpp LLKeyframeMotion::deserialize(LLDataPacker& dp) |
| #br | | #br |
| | | |
| *** Data Format [#iff1d38c] | | *** Data Format [#iff1d38c] |
- | 01 00 unknown0 | + | 01 00 "version" (U16) |
- | 00 00 unknown1 | + | 00 00 "sub_version" (U16) |
- | 04 00 00 00 Priority (int) | + | 04 00 00 00 "base_priority", Priority (S32, int) [mJointMotionList->mBasePriority] |
- | b4 54 75 40 Length (float) | + | b4 54 75 40 "duration", Length (F32, float) [mJointMotionList->mDuration] |
- | 00 Expression Name (string) | + | 00 "emote_name", Expression Name (string) [mJointMotionList->mEmoteName] |
- | 00 00 00 00 In Point (float) | + | 00 00 00 00 "loop_in_point", In Point (F32) [mJointMotionList->mLoopInPoint] |
- | b4 54 75 40 Out Point (float) | + | b4 54 75 40 "loop_out_point", Out Point (F32) [mJointMotionList->mLoopOutPoint] |
- | 01 00 00 00 Loop (int) | + | 01 00 00 00 "loop", Loop (S32) [mJointMotionList->mLoop] |
- | 00 00 00 3f Ease in Time (float) | + | 00 00 00 3f "ease_in_duration", Ease in Time (F32 [mJointMotionList->mEaseInDuration] |
- | 33 33 33 3f Ease out Time (float) | + | 33 33 33 3f "ease_out_duration", Ease out Time (F32) [mJointMotionList->mEaseOutDuration] |
- | 03 00 00 00 Hand Pose (unsigned int) | + | 03 00 00 00 "hand_pose", Hand Pose (U32, unsigned int) [mJointMotionList->mHandPose] |
- | 12 00 00 00 Joint Count (unsigned int) [Jointデータの数] | + | 12 00 00 00 "num_joints", Joint Count (U32) [Jointデータの数] |
| | | |
| // Joint Data | | // Joint Data |
- | 6d 50 65 6c 76 69 73 00 Joint Name (mPelvis) (string) | + | 6d 50 65 6c 76 69 73 00 "joint_name", Joint Name (mPelvis) (string) [joint_motion->mJointName] |
- | 04 00 00 00 Priority Revisited (int) | + | 04 00 00 00 "joint_priority", Priority Revisited (S32) [joint_motion->mPriority] |
| | | |
- | 24 00 00 00 Number of Rotation Keyframes (int) [Rotationデータの数] | + | 24 00 00 00 "num_rot_keys", Number of Rotation Keyframes (int) [Rotationデータの数] |
| + | [joint_motion->mRotationCurve.mNumKeys] |
| | | |
| // Rotation Keyframe data blocks | | // Rotation Keyframe data blocks |
- | 73 04 Time Code (unsigned int->float) In Point~Out Point にスケーリングし直し | + | 73 04 "time", Time Code (U16->F32に変換, old_versionでは元々F32) In Point~Out Point にスケーリングし直し |
- | 35 7b X (int) | + | 35 7b "rot_angle_x", X (U16) [rCurve->mKeys[time]] |
- | be 6a Y (int) | + | be 6a "rot_angle_y", Y (U16) |
- | 1f 52 Z (int) | + | 1f 52 "rot_angle_z", Z (U16) |
| | | |
- | e7 08 Time Code (unsigned int->float) | + | e7 08 "time", Time Code (U16->F32に変換, old_versionでは元々F32) |
- | 38 6f X (int) | + | 38 6f "rot_angle_x", X (U16) |
- | e8 b9 Y (int) | + | e8 b9 "rot_angle_y", Y (U16) |
- | 5d 77 Z (int) | + | 5d 77 "rot_angle_z", Z (U16) |
| ......................... | | ......................... |
| | | |
| | | |
- | 56 00 00 00 Number of Position Keyframes (int) [Positionデータの数] | + | 56 00 00 00 "num_pos_keys", Number of Position Keyframes (S32) [Positionデータの数] |
| + | [joint_motion->mPositionCurve.mNumKeys] |
| | | |
| // Position Keyframe data blocks | | // Position Keyframe data blocks |
- | 73 04 Time Code (unsigned int->float) In Point~Out Point にスケーリングし直し | + | 73 04 "time", Time Code (U16->F32に変換, old_versionでは元々F32) In Point~Out Point にスケーリングし直し |
- | ff 7f X (int) | + | ff 7f "pos_x", X (U16) [pCurve->mKeys[pos_key.mTime]] |
- | ff 7f Y (int) | + | ff 7f "pos_y", Y (U16) |
- | ca 7d Z (int) | + | ca 7d "pos_z", Z (U16) |
| | | |
- | e7 08 Time Code (unsigned int->float) | + | e7 08 "time", Time Code (U16->F32に変換, old_versionでは元々F32) |
- | ff 7f X (int) | + | ff 7f "pos_x", X (U16) |
- | ff 7f Y (int) | + | ff 7f "pos_y", Y (U16) |
- | bb 7d Z (int) | + | bb 7d "pos_z", Z (U16) |
| ......................... | | ......................... |
| + | |
| + | |
| + | "num_constraints" (S32) |
| + | "chain_length" (U8) [constraintp->mChainLength] |
| + | "constraint_type" (U8) [constraintp->mConstraintType] |
| + | "source_volume" (Binary 16bit, char*に変換) [constraintp->mSourceConstraintVolume] |
| + | "source_offset" (Vector3) [constraintp->mSourceConstraintOffset] |
| + | "target_volume" (Binary 16bit, char*に変換) [constraintp->mTargetConstraintVolume] |
| + | "target_offset" (Vector3) [onstraintp->mTargetConstraintOffset] |
| + | "target_dir" (Vector3) [constraintp->mTargetConstraintDir] |
| + | "ease_in_start" (F32) [constraintp->mEaseInStartTime] |
| + | "ease_in_stop" (F32) [constraintp->mEaseInStopTime] |
| + | "ease_out_start" (F32) [constraintp->mEaseOutStartTime] |
| + | "ease_out_stop" (F32) [constraintp->mEaseOutStopTime] |
| | | |
| | | |
| // Next Joint Data | | // Next Joint Data |
| ......................... | | ......................... |
| + | |
| + | *** Code [#nfe05d8e] |
| + | - mJointMotionList, joint_motion, joint_state |
| + | - JointMotion* joint_motion = mJointMotionList->getJointMotion(i); |
| + | - mJointMotionList->mConstraints.push_front(JointConstraintSharedData); |
| + | |
| + | //------------------------------------------------------------------------- |
| + | // JointMotionList |
| + | //------------------------------------------------------------------------- |
| + | class JointMotionList |
| + | { |
| + | public: |
| + | std::vector<JointMotion*> mJointMotionArray; |
| + | F32 mDuration; |
| + | BOOL mLoop; |
| + | F32 mLoopInPoint; |
| + | F32 mLoopOutPoint; |
| + | F32 mEaseInDuration; |
| + | F32 mEaseOutDuration; |
| + | LLJoint::JointPriority mBasePriority; |
| + | LLHandMotion::eHandPose mHandPose; |
| + | LLJoint::JointPriority mMaxPriority; |
| + | typedef std::list<JointConstraintSharedData*> constraint_list_t; |
| + | constraint_list_t mConstraints; |
| + | LLBBoxLocal mPelvisBBox; |
| + | // mEmoteName is a facial motion, but it's necessary to appear here so that it's cached. |
| + | // TODO: LLKeyframeDataCache::getKeyframeData should probably return a class containing |
| + | // JointMotionList and mEmoteName, see LLKeyframeMotion::onInitialize. |
| + | std::string mEmoteName; |
| + | public: |
| + | JointMotionList(); |
| + | ~JointMotionList(); |
| + | U32 dumpDiagInfo(); |
| + | JointMotion* getJointMotion(U32 index) const { llassert(index < mJointMotionArray.size()); return mJointMotionArray[index]; } |
| + | U32 getNumJointMotions() const { return mJointMotionArray.size(); } |
| + | }; |