A quick question about collide

There are no stupid questions, just stupid answers.
4 posts Page 1 of 1
Jason Campbell
Posts: 271
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Sat May 26, 2018 6:52 pm
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()); }
LukasPJ
Site Admin
Posts: 386
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sat May 26, 2018 8:00 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.
OTHGMars
Posts: 23
Joined: Fri Jul 14, 2017 2:19 am
by OTHGMars » Sun May 27, 2018 12:00 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.
Jason Campbell
Posts: 271
Joined: Fri Feb 13, 2015 2:51 am
 
by Jason Campbell » Sun May 27, 2018 6:30 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.

@
User avatar
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.
4 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests