Game Development Community

DTS Collision and Scale issue

by Tim Newsome-Ward · in Torque X 3D · 11/05/2009 (11:42 am) · 4 replies

Hey guys & girls,

I was wondering if anyone had any issues’ with scaling a static DTS shape and losing their collision?

I've been trying to get collision working using a test polygon, just to see if my character can bounce off it.

It works fine when I try it, but if I scale the static shape the collision goes. I've made a quick two videos to show:

With collision:

www.vimeo.com/7453771

No Collision:

www.vimeo.com/7453806

I'm not sure if it’s a problem with the bounding box, but as I understand polysoup it calculates collision against each triangle in the mesh.

Anyway, any help would be appreciated!:-)

Thanks,

#1
11/06/2009 (7:41 am)
Sorry to bump,

But this is getting a little frustrating. Ok I've figured out now that there are some errors with the whole world of 3D matrix transformations within Torque X.

I have simpley added a shape to my level using the xml:
<StaticGeometry type="GarageGames.Torque.Core.TorqueObject">
      <Components>
        <RenderComponent type="GarageGames.Torque.T3D.T3DStaticTSRenderComponent">
          <ShapeName>datashapesenvironmentskip.dts</ShapeName>
        </RenderComponent>
        <StaticGeometryComponent type="GarageGames.Torque.T3D.T3DStaticGeometryComponent">
          <Rotation>
            <X>0</X>
            <Y>0</Y>
            <Z>0</Z>
            <W>0</W>
          </Rotation>
          <Position>
            <X>350</X>
            <Y>300</Y>
            <Z>6.5</Z>
          </Position>
          <Scale>
            <X>1</X>
            <Y>1</Y>
            <Z>1</Z>
          </Scale>
        </StaticGeometryComponent>
        <RigidComponent type="GarageGames.Torque.T3D.T3DRigidComponent">
          <RigidManager nameRef="RigidManager" />
          <Immovable>true</Immovable>
        </RigidComponent>
      </Components>
    </StaticGeometry>

Now the only transform that works properly is position and scale(although collision vanishes). If i try and rotate the shape within the XML, it SCALES instead?

I would really appreciate someones insight on this and if anyone else has encountered this problem.

Just to note, I tried this on the FPS demo and the same things happen?

Thanks
#2
11/06/2009 (3:32 pm)
Wow, that is pretty messed up. I've been having some goofy behavior with scaling and collision also. I chalked it up to my Torque n00bness, but at least I am not alone. I will mess with your example this weekend and see if I can break anything and post some results.
#3
11/07/2009 (6:46 am)
Ha ha,

Yeah I'm in the nOObness clan too. Thanks for the reply, hopefully we can figure a fix or else I may have to move my poject to 2D as TX3D will just been unsuable, this wouldn't be too much of a problem if the builder worked -sigh- ;-)

#4
11/11/2009 (2:53 pm)
ok,

Again a little more reading and playing around and I realised this works

<StaticGeometry type="GarageGames.Torque.Core.TorqueObject" name="TorqueObject_4705914">
      <Components>
        <RenderComponent 	type="GarageGames.Torque.T3D.T3DStaticTSRenderComponent">
          <ShapeName>data\shapes\environment\post.dts</ShapeName>
          <SceneGroup>TorqueObject_20031746</SceneGroup>
        </RenderComponent>
        <StaticGeometryComponent 	type="GarageGames.Torque.T3D.T3DStaticGeometryComponent">
          <SceneGroupName>TorqueObject_20031746</SceneGroupName>
          <Position>
            <X>267.5786</X>
            <Y>203.4687</Y>
            <Z>5.9</Z>
          </Position>
          <Rotation>
            <X>0</X>
            <Y>0</Y>
            <Z>0.6448342</Z>
            <W>0.7643226</W>
          </Rotation>
          <Scale>
            <X>1</X>
            <Y>1</Y>
            <Z>1</Z>
          </Scale>
        </StaticGeometryComponent>
        <RigidComponent type="GarageGames.Torque.T3D.T3DRigidComponent">
          <RigidManager nameRef="RigidManager" />
          <Immovable>true</Immovable>
        </RigidComponent>
      </Components>
    </StaticGeometry>

Although this still won't let you scale the collision box, but I assume that would have to be done manually?

Anyhow, I usually build the models first with the correct scale so this, hopefullt shoul be an issue!