Jason Campbell Posted May 26, 2018 Share Posted May 26, 2018 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. function WheeledVehicleData::onCollision(%this, %obj, %col, %vec, %speed) { // Collision with other objects, including items echo("car collision:",%col.getName()); } Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted May 26, 2018 Share Posted May 26, 2018 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/blob/development/Engine/source/T3D/vehicles/wheeledVehicle.cpp#L50-L55Would have to add TSStatic there. Quote Link to comment Share on other sites More sharing options...
OTHGMars Posted May 26, 2018 Share Posted May 26, 2018 TSStatic is a StaticShapeObjectType, so that mask should detect it.https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/tsStatic.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/blob/development/Engine/source/T3D/vehicles/vehicle.cpp#L1415-L1419https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/vehicles/vehicle.cpp#L1610-L1624You could make your rocks StaticShape instead of TSStatic and get the callbacks. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted May 27, 2018 Author Share Posted May 27, 2018 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. Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted October 6, 2018 Share Posted October 6, 2018 What happens when you have a large city? I thought TSstatic was made to avoid all the overhead of the staticshape. I have vehicles crashing into buildings all over. My quick temporary fix function PickupTruck::onImpact(%this, %obj, %col,%vec,%vecLen){ echo("IMPACT "@%obj SPC %col SPC %vecLen);}%vecLen does give me a value so I use that to put damage on the truck... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.