//---------------------------------------------------------------------------- void UIBagFrame::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); UIPushFrame::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mIsBagFrameNeedUpdate); target.WriteEnum(mAlignItemType); target.WriteAggregate(mSize); target.WriteAggregate(mCornorSize); target.WriteAggregate(mItemSize); target.WriteAggregate(mAlignItemNum); PX2_END_DEBUG_STREAM_SAVE(UIBagFrame, target); }
//---------------------------------------------------------------------------- void Controller::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Object::Save(target); target.WriteEnum(Repeat); target.Write(MinTime); target.Write(MaxTime); target.Write(Phase); target.Write(Frequency); target.WriteBool(Active); target.WritePointer(mObject); PX2_END_DEBUG_STREAM_SAVE(Controller, target); }
//---------------------------------------------------------------------------- void Movable::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Controlledable::Save(target); target.WriteAggregate(LocalTransform); target.WriteAggregate(WorldTransform); target.WriteBool(WorldTransformIsCurrent); target.WriteAggregate(WorldBound); target.WriteBool(WorldBoundIsCurrent); target.WriteEnum(Culling); // mParent不被保存,它会在Node::Link中调用Node::SetChild被设置。 PX2_END_DEBUG_STREAM_SAVE(Movable, target); }
//---------------------------------------------------------------------------- void Spatial::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); ControlledObject::Save(target); target.WriteAggregate(LocalTransform); target.WriteAggregate(WorldTransform); target.WriteBool(WorldTransformIsCurrent); target.WriteAggregate(WorldBound); target.WriteBool(WorldBoundIsCurrent); target.WriteEnum(Culling); // mParent is not saved. On load, it will be set in Node::Link when the // child pointers of the Node are resolved by Node::SetChild. WM5_END_DEBUG_STREAM_SAVE(Spatial, target); }
//---------------------------------------------------------------------------- void TriggerActor::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); Actor::Save(target); PX2_VERSION_SAVE(target); target.WriteBool(mEnable); target.WriteEnum(mAreaType); target.Write(mBox.Min[0]); target.Write(mBox.Min[1]); target.Write(mBox.Min[2]); target.Write(mBox.Max[0]); target.Write(mBox.Max[1]); target.Write(mBox.Max[2]); target.WriteAggregate<Vector3f>(mSphere.Center); target.Write(mSphere.Radius); PX2_END_DEBUG_STREAM_SAVE(TriggerActor, target); }
//---------------------------------------------------------------------------- void Jungler::Save (OutStream& target) const { PX2_BEGIN_DEBUG_STREAM_SAVE(target); TriMesh::Save(target); PX2_VERSION_SAVE(target); target.WriteEnum(mJunglerType); target.Write(mMaxNum); target.WritePointer(mMtlInst); target.WritePointer(mTexture); int num = (int)mPoses.size(); target.Write<int>(num); if (num > 0) { target.WriteAggregateN<APoint>(num, &mPoses[0]); target.WriteAggregateN<AVector>(num, &mNormals[0]); target.WriteN<float>(num, &mWidths[0]); target.WriteN<float>(num, &mHeights[0]); } PX2_END_DEBUG_STREAM_SAVE(Jungler, target); }
//---------------------------------------------------------------------------- void RevolutionSurface::Save (OutStream& target) const { WM5_BEGIN_DEBUG_STREAM_SAVE(target); TriMesh::Save(target); target.Write(mXCenter); target.WriteEnum(mTopology); target.Write(mNumCurveSamples); target.Write(mNumRadialSamples); target.WriteN(mNumRadialSamples + 1, mSin); target.WriteN(mNumRadialSamples + 1, mCos); target.WriteBool(mSampleByArcLength); // TODO. The class Curve2 is abstract and does not know about the data // representation for the derived-class object that is passed to the // RevolutionSurface constructor. Because of this, any loaded // RevolutionSurface object will require the application to manually set // the curve via the Curve() member. // // Streaming support should be added to the curve classes. WM5_END_DEBUG_STREAM_SAVE(RevolutionSurface, target); }