Collision cylinder player

Blitz3D Forums/Blitz3D Programming/Collision cylinder player

Yue(Posted 2012) [#1]
Hello, I'm having trouble putting the player in a capsule or cylinder that makes the collision in the world, the idea was that the center cylinder pelvis taken as the character, but as the center takes the player's feet, any suggestions.





Edit: there is a function to change the center of the cylinder?.

Last edited 2012


RemiD(Posted 2012) [#2]
If you are using Blitz3d colliders and collisions, there is no cylinder collider.
You can do either
sphere collider against sphere collider
or
sphere collider against box collider
or
sphere collider against mesh collider (low tris is faster)

In order to change the radius of the sphere collider, you can use EntityRadius(Collider,Radius#) (Collider being a pivot or the origine of the mesh)

Then you have to set the collisions detection method and response with Collisions(Collider1,Collider2,detectionmethod%,response%) the Collider1 being the moving one and the Collider2 being the static one.

Last edited 2012


DRH(Posted 2012) [#3]
If I understand the problem correctly, then you just have to move the player down the correct amount so that the character is set correctly into the object your using. I think what your trying to do is use the cylinder under the very costly but accurate collision setting that checks all the vertices, but then again I haven't worked in true 3d in a while so I may be misunderstanding. Either that or my terminology is off. But if that's what your intending then you should be able to move the character down to correctly line up with the cylinder's bottom. It appears as if the bottom of your mesh is centered in the cylinder. Did you set the cylinder as the mesh's parent? anyways, it all depends on whether your character is more than one mesh or if it is a single entity and then can be appropriately aligned with the cylinder that will act as the colliding object. just be sure not to set both the mesh and the cylinder as collide able objects.


RemiD(Posted 2012) [#4]
What i would do in this case is :
Create a pivot with a collider sphere with a radius of 0.25 (0.5 being approximately the width of a human body).
Position the pivot + 0.251Y above the ground
Set the mesh as a child of this pivot.
Move the mesh down -0.25Y so that i appears to be on the ground.
Set the collision detection mode and response between the collider sphere and the collider of the scene.
Then in order to move the character, move the pivot (the collider sphere), not the mesh.

Last edited 2012


Zethrax(Posted 2012) [#5]
I always use a pivot as the entity for my game character and then add the mesh to that as Remi said. The mesh is just the visual representation of the game character.

Bear in mind that if your mesh is too far off center then its bounding box will also be off center and you may get frustum culling issues. Try to model or edit the mesh so that its mesh centerpoint is as near to the centerpoint of its local entity space as possible. I think most good modeling programs have an option to center the model, though I could be wrong.