Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Collision without Physics?

Recommended Posts

is it possible to have collisions and stuff without need to use of phyisics?

I want to move the entitys just with moveEntity() and stuff and check if they touched something.


i know i can start now writing the raycasting stuff, but there is still all that stuff and i dont want to waste alot of time for making raycast tests, is it not possible to use it without body force stuff?


i dont want them to fly around or falling down after a collision when i use apply force stuff,

i just want them to have collisions, maybe slide but at all i just want the callback.

Link to post

hm bounding boxes would not work since i got some kind complex terrain

for now i use SetBodyVelocity and try it with that, but there is so much stuff that is annoying, i dont need/want all thet physic stuff and now i need to waste cpu/gpu time into this, and then i just force the values to some fixed ones ><


seems i rly need to start over with that raycast stuff :)

Link to post

I think bounding boxes would still work wouldn't it? With the EachEntityInAABBDo() function you can ignore things you don't care about like the terrain and instead look for other things that are colliding and react.


Or are you wanting to do your own gravity with this this? For gravity without physics on terrains only you could get the players x & z position, then get the terrains height (there are functions for this) of the same position, then position your players y value to that.

Link to post

i want to check my entity VS those map terrain (somewhat minecraft like map)

i use createBodyTree for the clipping parts of the blocks

i dont think i can use simple aabb tests there, but maybe i should have ben said earlier


but for now i improved something with that body stuff, i use moveEntity, and before every move i use setBodyVelocity with 0,0,0, and i force the angle of the mover body to stay like it is.


maybe i will later have alot fun with that physics thingie so i think i just let it so for now.




Why not use physics but just set mass to 0.0 on objects.


i tried that, but then i got no collision, the body is allways red with the phyisc debug mode

Link to post

Yeah, the controller is meant for moving things easily with physics easily and not worrying about it falling over because of incorrect force applying. It's basically meant to easily move your characters around with physics.

Link to post

i slaughtered a sample now for a quick & dirty test =)

for now it seems to be fine, no bouncing and strange rotating or something.


but it acts more like a spaceship in space then a person on ground.


i mean it takes a while until it comes to speed, and then when i release the key it have a long way to brake.


what am i doing wrong?


i did this before the loop:


Global testController:TController = CreateController()
SetBodyMass(testController, 1)
PositionEntity(testController, Vec3(15, 4, 15)) 'set it into the map
EntityType(testController, 1)
Collisions(1, 2, 1)'world is 2, entitys got 1
Global move:Int = 0.0
Global strafe:Int = 0.0


and thats the loop:

If KeyHit(KEY_ESCAPE) Exit
If AppTerminate() Exit
move = (KeyDown(KEY_W) - KeyDown(KEY_S)) * 5
strafe = (KeyDown(KEY_D) - KeyDown(KEY_A)) * 5
UpdateController(testController, 0.0, move, strafe)



Link to post

Look at the function definition to UpdateController. There are more than what you have so that means you are using defaults. There is an acceleration parameter. The higher you set that the faster starting and stopping is. Play around with that value and you'll get better response.

Link to post

cool thank you, that acceleration parameter in the updateController function was the problem =)

no i have a nice moving "player" with colision to the map.


thank you all for your time.

Link to post

Join the conversation

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

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.

Facebook Twitter Youtube Github Steam
  • Create New...