Changeset 1597
- Timestamp:
- Jul 8, 2012, 7:36:10 PM (9 years ago)
- Location:
- trunk/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/PhysicObject.h
r1593 r1597 45 45 MeshRand << "[sc#aad afcb2 2 2 -.1]"; 46 46 47 int SphereLimit = MeshRand.Count(); 48 49 MeshRand << "[sc#add asph16 2 2 2]"; 50 MeshRand << "[sc#dad asph16 2 2 2]"; 51 MeshRand << "[sc#dda asph16 2 2 2]"; 52 MeshRand << "[sc#daa asph16 2 2 2]"; 53 MeshRand << "[sc#ada asph16 2 2 2]"; 54 MeshRand << "[sc#aad asph16 2 2 2]"; 55 56 47 57 int RandValue = (int)(lol::RandF() * (MeshRand.Count() - 1)); 48 58 49 59 m_mesh.Compile(MeshRand[RandValue]); 50 60 vec3 BoxSize = vec3(2.0f); 51 m_physics.SetShapeToBox(BoxSize); 61 if (RandValue >= SphereLimit) 62 m_physics.SetShapeToSphere(BoxSize.x); 63 else 64 m_physics.SetShapeToBox(BoxSize); 52 65 m_physics.SetMass(base_mass); 53 66 m_physics.SetBaseTransform(base_location); -
trunk/test/Physics/EasyPhysics.cpp
r1595 r1597 69 69 } 70 70 71 //void EasyPhysics::SetShapeToSphere(lol::vec3& box_size)72 //{73 // SetShapeTo(new btBoxShape(LOL2BT_VEC3(box_size * LOL2BT_UNIT * LOL2BT_SIZE)));74 //}71 void EasyPhysics::SetShapeToSphere(float radius) 72 { 73 SetShapeTo(new btSphereShape(radius * LOL2BT_UNIT * LOL2BT_SIZE)); 74 } 75 75 76 76 //------------------------------------------------------------------------- -
trunk/test/Physics/EasyPhysics.h
r1591 r1597 37 37 38 38 void SetShapeToBox(lol::vec3& box_size); 39 void SetShapeToSphere(float radius); 39 40 void SetBaseTransform(const lol::vec3& base_location, const lol::quat& base_rotation=lol::quat(lol::mat4(1.0f))); 40 41 void SetMass(float mass);
Note: See TracChangeset
for help on using the changeset viewer.