AnniXa Posted May 8, 2012 Share Posted May 8, 2012 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. Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2012 Share Posted May 8, 2012 Could use the bounding boxes (AABB). It won't give you perfect collision checking but it could do the trick. Quote Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 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 Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2012 Share Posted May 8, 2012 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. Quote Link to comment Share on other sites More sharing options...
cassius Posted May 8, 2012 Share Posted May 8, 2012 Why not use physics but just set mass to 0.0 on objects. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 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 1 Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2012 Share Posted May 8, 2012 Right, you can't use MoveEntity with physics bodies as it turns off the physics. You'd have to either use the controller or forces. Quote Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 oh, when i use the controler, they collision also works fine? i never tried those controlers.... can i use them to just move an entity into a direction? Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2012 Share Posted May 8, 2012 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. Quote Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 Okay thank you very much, i actually read that pdf about them, and they seem to be like the solution for my problem =) Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted May 8, 2012 Share Posted May 8, 2012 I've done this before by using raycasts. It's not easy though. Just use the LE Controller Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 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() CreateCube(testController) 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: Repeat 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) UpdateAppTime() UpdateWorld(AppSpeed()) SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) tann2d.start2d() anngui.draw() tmouse.draw() tann2d.end2d() Flip(0) Forever Quote Whuts wroong? Link to comment Share on other sites More sharing options...
Rick Posted May 8, 2012 Share Posted May 8, 2012 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. Quote Link to comment Share on other sites More sharing options...
AnniXa Posted May 8, 2012 Author Share Posted May 8, 2012 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. Quote Whuts wroong? 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.
Note: Your post will require moderator approval before it will be visible.