Static collision problems
by luggage · in Torque X 2D · 06/14/2008 (8:56 pm) · 5 replies
Hello
When I add my own .dts file to the FPSDemo it all works perfectly when the scale is 1,1,1. If I change the scale of the object to 4,4,4 the collision seems out. It's larger than the visual model and not as high. Is there something else I'm supposed to do?
Thanks
Scott
When I add my own .dts file to the FPSDemo it all works perfectly when the scale is 1,1,1. If I change the scale of the object to 4,4,4 the collision seems out. It's larger than the visual model and not as high. Is there something else I'm supposed to do?
Thanks
Scott
About the author
#2
If the scale is 1, 1, 1 everything is fine. If I set it to 4,4,4 the model is bigger but the collision box is wrong. The collision is definately scaled but it's too wide and not tall enough - something happens to it but I can't tell what. Is there a way to render the collision box?
06/15/2008 (3:43 pm)
I don't seem to have a collision body size. I have the following...<StaticGeometry type="GarageGames.Torque.Core.TorqueObject">
<Components>
<RenderComponent type="GarageGames.Torque.T3D.T3DStaticTSRenderComponent">
<ShapeName>data/shapes/structures/GeneralStore.dts</ShapeName>
</RenderComponent>
<StaticGeometryComponent type="GarageGames.Torque.T3D.T3DStaticGeometryComponent">
<Position>
<X>315.18</X>
<Y>-180.418</Y>
<Z>244.913</Z>
</Position>
<Rotation>
<X>0</X>
<Y>0</Y>
<Z>-0.9903263</Z>
<W>-0.1387582</W>
</Rotation>
<Scale>
<X>4</X>
<Y>4</Y>
<Z>4</Z>
</Scale>
</StaticGeometryComponent>
<RigidComponent type="GarageGames.Torque.T3D.T3DRigidComponent">
<RigidManager nameRef="RigidManager" />
<Immovable>true</Immovable>
</RigidComponent>
</Components>
</StaticGeometry>If the scale is 1, 1, 1 everything is fine. If I set it to 4,4,4 the model is bigger but the collision box is wrong. The collision is definately scaled but it's too wide and not tall enough - something happens to it but I can't tell what. Is there a way to render the collision box?
#3
First the sphere
also the box
You can also set these manually in code, it might be easier then writing to a txscene file
06/15/2008 (7:52 pm)
I have no idea how that rigid component is working, it doesnt seem to have a collision shape at all, here are some examples of what i'm talking about, taken from the desertPhysics.txscene fileFirst the sphere
<RigidComponent type="GarageGames.Torque.T3D.T3DRigidComponent">
<RenderCollisionBounds>false</RenderCollisionBounds>
<CollisionShapes>
<CollisionShape>
<Shape type="GarageGames.Torque.T3D.RigidCollision.CollisionSphereShape">
<Radius>0.25</Radius>
<Center>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Center>
</Shape>
</CollisionShape>
</CollisionShapes>
<GravityScale>1.5</GravityScale>
<RotationScale>1.0</RotationScale>
<RigidManager nameRef="RigidManager" />
<RigidMaterial type="GarageGames.Torque.T3D.RigidCollision.RigidMaterial">
<Restitution>0.2</Restitution>
<KineticFriction>1.8</KineticFriction>
<StaticFriction>1.4</StaticFriction>
</RigidMaterial>
</RigidComponent>also the box
<RigidComponent type="GarageGames.Torque.T3D.T3DRigidComponent">
<RenderCollisionBounds>false</RenderCollisionBounds>
<ResolveCollisions>true</ResolveCollisions>
<Mass>2.5</Mass>
<CollisionShapes>
<CollisionShape>
<Shape type="GarageGames.Torque.T3D.RigidCollision.CollisionBoxShape">
<Size>
<X>4.0</X>
<Y>4.0</Y>
<Z>4.0</Z>
</Size>
<Center>
<X>0.0</X>
<Y>0.0</Y>
<Z>0.0</Z>
</Center>
</Shape>
</CollisionShape>
</CollisionShapes>
<RotationScale>1.0</RotationScale>
<GravityScale>1.5</GravityScale>
<RigidManager nameRef="RigidManager" />
<RigidMaterial type="GarageGames.Torque.T3D.RigidCollision.RigidMaterial">
<Restitution>0.1</Restitution>
<KineticFriction>0.9</KineticFriction>
<StaticFriction>0.7</StaticFriction>
</RigidMaterial>
</RigidComponent>You can also set these manually in code, it might be easier then writing to a txscene file
#4
06/15/2008 (8:07 pm)
I used the same stuff as the buildings in the desertlevel.txscene. I'm using the FPSDemo as a base.
Torque 3D Owner Will O-Reagan
Modern Intrigues
Will