Engine doubt

Posted By: vasco

Engine doubt - 10/08/09 17:58

In a Game engine with Physics, I understand that collision detection and reaction are taken care by the engine itself. How can I activate it or in simple, how can i get the physics of Collision reaction between two balls in my game ?
Is there a script associated ( a wdl file) that I need to import ?
Also, how can I instantiate a model placed on the world via WED and not from code.
Posted By: Cowabanga

Re: Engine doubt - 10/08/09 18:01

The collision is automatic. Except if you're using my.x += XX.
Posted By: vasco

Re: Engine doubt - 10/08/09 18:28

Thats Awesome. I am beginning to like this !
So, are you saying that If I direct a player to move to a place with a mouse click on the destination and if there are any obstacles, collision detection and reaction are automatic ?
Posted By: darkinferno

Re: Engine doubt - 10/08/09 18:31

thats if you move your player using the physics engine and the objects in the way have physics enabled on them, if not, then the moving entity will just collide or slide along the obstacles
Posted By: vasco

Re: Engine doubt - 10/08/09 19:08

I cant understand the difference between moving with Physics enabled and not having it enabled; Can you give me some more insight or some Document to read on this.
As I said, when the user clicks on a position on a plane, then I want a ball to move to that point ( also take into consideration the balls in between the two points). A simple example can be that of a snooker table !
I would be glad to get some content related to this..
Posted By: delinkx

Re: Engine doubt - 10/13/09 08:43

Well there are 2 ways to move your entity:

1. without physics.
2. with physics

for 1., u move the entity based on cordinates, distances, relative directions, etc., and the entities perform collision detections if u use c_move

but when u want to move an entity with physics, the its the force applied to it and the direction of the force that makes it move and the motion will be based on the physics parameters u set for that entity and also perform collisions in between the movement.

well, for snooker, the rule is not click a point and make ball move to that part. but instead u hit the cue ball with a force in a particular direction. so u need to apply a local force to the cue ball in a direction and the ball will move with all its physics parameters, taking care of the balls in between.

even if u want point and click, u need to calculate the direction from cue point to the clicked position. and apply the force on the ball in that direction.
Posted By: indiGLOW

Re: Engine doubt - 10/22/09 21:59

With Physics:
Using physics, the objects will move and interact according to the settings you give them, the world they exist in, i.e. gravity,friction, mass amd so forth, only moving based on applying forces to them directly or indirectly, for example a ball rolling down a slope.

Without Physics:
Using move functions like c_move and c_rotate you can instruct an entity to move around the game world. Variables such as GLIDE or IGNORE_PASSABLE can change the way these entities interact with other objects.

In most cases you would probably not use Physics unless your game really requires it, such as a snooker or pool game. For example a while ago I created a roller ball style game that used invisible physics balls for each player, creating a more fluid and realistic form of movement, but this is something of an edge case.

If I was you I would take a look at the manual and some of the tutorials to get a good grip on movement in the engine.

Hope that helps grin
© 2024 lite-C Forums