### A quick question about collide

There are no stupid questions, just stupid answers.

#### Re: A quick question about collide

Jason Campbell
Posts: 266
Joined: Fri Feb 13, 2015 2:51 am

This is strange, I added this to vehicleWheeled.cs in scripts/server to see what was happening and it only registers if I hit AIPlayer, Bouncy Rocks, AITurrets but not TSStatic shapes. I'll keep looking into this, I hope tonight.

Code: Select all

function WheeledVehicleData::onCollision(%this, %obj, %col, %vec, %speed) { // Collision with other objects, including items echo("car collision:",%col.getName()); }

#### Re: A quick question about collide

LukasPJ
Posts: 388
Joined: Tue Feb 03, 2015 7:25 pm

It would seem someone decided not to have collisions with TSStatic's as they aren't really meant to be interacted with I guess.
The culprit is here:
https://github.com/GarageGames/Torque3D ... pp#L50-L55

Would have to add TSStatic there.

#### Re: A quick question about collide

OTHGMars
Posts: 25
Joined: Fri Jul 14, 2017 2:19 am
TSStatic is a StaticShapeObjectType, so that mask should detect it.
https://github.com/GarageGames/Torque3D ... c.cpp#L108.

Edit: And it does, but LukasPJ is correct. Apparently it was decided that Vehicles should only generate collision callbacks for ShapeBase derived objects.
https://github.com/GarageGames/Torque3D ... 1415-L1419
https://github.com/GarageGames/Torque3D ... 1610-L1624
You could make your rocks StaticShape instead of TSStatic and get the callbacks.

#### Re: A quick question about collide

Jason Campbell
Posts: 266
Joined: Fri Feb 13, 2015 2:51 am

I just tried to get StaticObjectType added to the mask. I added it and included tsStatic.h and it compiled without errors but still did not detect TSStatic on collision.

Think it was removed because TSStatics are just supposed to sit there.

@
OTHGMars
: probably that is the answer, using StaticShapes. OP could also mess about with Rigid Shapes and applyImpulse to the collision for some simple movement stuff.

#### Who is online

Users browsing this forum: No registered users and 4 guests