Jump to content

Suggestions how best to do this...


flysouth

Recommended Posts

only when the player hits the door's collision area.

I am a bit puzzled by this... Collisions are dont have to be with a player. A non moving object can detect when something colides with it. Does this not mean thast the object is also constantly doing a check?
Link to comment
Share on other sites

Without opening a great big can of worms...no, objects with collision meshes are not constantly doing collision checks while idling. All objects that could potentially collide against something else share one thing in common: they have to be moving to collide with something. This being the case, the moving object should be testing against things for collision - hence why we have the Player class searching for Triggers in its onContact() function.


Unfortunately I don't have the time this morning to break down T3D's collision system, but I'll try to touch on the important parts: Objects that support collision will have a castRay() function in the class's source file, to be used when another object queries against it for collision. So if %objA is a rock with a collision and %objB is any other moving object - if %objB collides against %objA(the nonmoving rock) then %objA's castRay() code will be called to check for the collision. Players specifically will keep track of a collisionWorkingList of objects they are colliding with to help keep things in sync client/server.


Off the top of my head I wanna say it was the physicsShape.cpp file where you could look for yourself and see what data is actually streamed and updated by a physics enabled object.IIRC the physics rep is only dealing with mass/buoyancy and things like that.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...