| 139 | static const PxSerialObjectId mMotorJoint1_id = (PxSerialObjectId)0x04; |
| 140 | |
| 141 | void Crab::save(const char* filename) |
| 142 | { |
| 143 | PxPhysics& physics = mSampleSubmarine->getPhysics(); |
| 144 | PxCollection* thePxCollection = PxCreateCollection(); |
| 145 | PxSerializationRegistry* sr = PxSerialization::createSerializationRegistry(physics); |
| 146 | for(PxU32 i = 0; i < mActors.size(); ++i) |
| 147 | { |
| 148 | thePxCollection->add(*mActors[i]); |
| 149 | } |
| 150 | |
| 151 | for(PxU32 i = 0; i < mJoints.size(); ++i) |
| 152 | { |
| 153 | thePxCollection->add(*mJoints[i]); |
| 154 | } |
| 155 | |
| 156 | thePxCollection->addId(*mCrabBody, mCrabBody_id); |
| 157 | thePxCollection->addId(*mMotorJoint[0], mMotorJoint0_id); |
| 158 | thePxCollection->addId(*mMotorJoint[1], mMotorJoint1_id); |
| 159 | |
| 160 | PxCollection* theExtRef = PxCreateCollection(); |
| 161 | theExtRef->add(*mSampleSubmarine->mMaterial, mMaterial_id); |
| 162 | |
| 163 | PxSerialization::complete(*thePxCollection, *sr, theExtRef); |
| 164 | |
| 165 | PxDefaultFileOutputStream s(filename); |
| 166 | PxSerialization::serializeCollectionToBinary(s, *thePxCollection, *sr, theExtRef); |
| 167 | |
| 168 | theExtRef->release(); |
| 169 | thePxCollection->release(); |
| 170 | sr->release(); |
| 171 | } |
| 172 | |
| 173 | static PxU32 GetFileSize(const char* name) |
| 174 | { |
no test coverage detected