Right, so still with the same .cap. Name one of the smileys to anything you like.
Go to the Events editor.
Add an event to the empty sheet.
Start from the smiley object.
In the next step of the wizard, where you are supposed to choose a condition ..
Notice the object has 2 tabs on top.
Its own tab and a tab called Physics.
Click the Physics tab.
Wah ? no conditions for the Physics behavior ? Ah yes sir. In the present release the Physics still lack conditions. This will be something we will have to work around. And oh we will. Do not worry.
Maybe in a next release there will be conditions added.
Possible conditions could be:
On 'object' is moving.
On 'object' bounce.
On 'object' at turn point.
On 'object' slowing down
on 'object' speeding up.
Compare 'objects" X velocity
Compare 'objects" Y velocity
But for now, no conditions. We will counter this.
So add a system event from the system condition "always". To explore the actions.
Add an action to this. Start from the smiley object. Click on the physics Tab.
Yes sir ! There are a bunch of actions here.
Lets walk trough them.
1/ Add force.
Imagine a paper airplane passing you. And you give it a little slam to make it fly faster. Thats what 'Add force' is meant for. The paper plane was moving already due a force given by some one else earlier, and you add your own force to it. Now slamming that airplane makes it move according the angle that you slammed it. Slam it with your hand moving from down to up, will cause the plane to move upwards. This is why Force has 2 values, X and Y component. When you add a force, you will have to figure out the X and Y component of this force. X and Y components relate to each other as cos and sin. but that is for later.
2/
Set force.
Imagine you catch that paper airplane. And trow it yourself by your own force. In other words, take away the force that the paper plane already had, and change it to only your force = set force
3/ Add force towards a position.
Read: add a force to an object so, that when the object on the moment that you add this force and it was not moving by any other forces, it will move to the given position. Simply said: Add a force to a non moving object and as result it moves to the given position. Of course, since you "add", this new force, it will add to the forces that make the object already move, so its not sure that it will move towards the given position as result.
lets say, there is a car passing you. And you give it by hand a force towards the middle of the road (position). The car will hardly change direction, since the forces that move it already, added with your force to push it to the middle do not change much at the global situation.
4/ Set force towards position.
Take all the possible forces from an object and add a new force resulting in the object moving to the given position. Or: Stop the object, then move it towards the given position by the given force.
Or: Stop the car and push it to the given direction.
5/ Create Hinge to position.
Make the object glue to a certain position, with a given Stiffness.
Like lets say. A door hanging in its hinges. When you slam the door, it will try to keep its position to the hinges. Hinge to a position is like hinging the object to an immovable object.
6/ Create Hinge to object.
Same as 5 but to an object, lets say a door to a wall.
When you slam the door with a big force: the hinges will break. And an even bigger force will hang the wall at the door while both move into space.
Also, when the door has way more mass then the walls, the door will move the walls.
7/Set Gravity enabled.
On or off for this object.
8/Set mass.
Make the object lighter or more heavy.
9/Set linear damping.
Damp the accelerations in the moving forces.
10/ Set Force of gravity.
9,8 on earth.
11/ Add torque.
Ok, we had force.
When you hit a ball, you add a force to it.
When you balance the ball on the tip of one of your fingers, and give it a little push to rotate it, you add torque to it.
When the ball was already rotating on that moment, your torque will be added to the forces (torque) that made it rotate already.
12/ Set torque.
Thats like stopping the rotation of the ball and give it a new rotation.
Or:
Take away any torque off the object, and give it a totally new torque.
13/Set torque towards object.
Well see it as. When you sit with 2 people at a table. Lay a pencil on the table. Point it to yourself. And give it a little push so it rotates towards the other person.
Or: take all torque of an object, give it a new torque, with as result that the object will rotate from the current angle towards the given angle.
Of course, if you give it a big torque, it will take less time to reach the given angel.
14/ Add torque towards angle.
Well, suppose you hit the pencil to hard. Its about to rotate more then you intended. Risking to face back to you. And you give it a little push, to correct its rotation towards the other person.
Thats "add torque towards an angle".
15 Set velocity.
Imagine. A car toy in the middle of the room. You give it a push to make it move. Then you disappear from the room.
I enter the room, and there is no way for me to know what force you used to make the toy move.
I can not know what torque you used to make it rotate.
But i see the result. The toy is moving, rotating, accelerating, de-accelerating.
What i see, the result = the velocity.
I know when the car is going slower, when i compare its velocity on different moments by eye. When its velocity is less then it was a moment ago, its going slower. If the toy is moving away from me, and i put myself as reference to this world, the velocity will be positive. If the toy is moving towards me, it will be negative.
Velocity = speed ? Yes and no. When working with physics, objects mostly do not have a constant speed. But yes, if we make the moment that we measure very very small in time, it comes close to measuring speed. So yes velocity gives a good indication for speed. And by comparing velocity measured over moments in time, we can know if the object is slowing down or going faster.
Velocity, just like force, has a X and Y component. Maybe a little picture is on its place here.
<img src="http://usera.imagecave.com/j0h/tick/vector.jpg">
We can set in an action the X and Y velocity components that combined make up the way, the speed, the direction.. the object is moving. Combine negative and positive X and Y components allow us to describe any direction , any speed.
So we only need to know how to set the velocity and forget about torque and force ?
No sir. After all a Physics system is meant to simulate real world forces. In the real world you push an object to make it move (add a force to it). The object will start moving depending on its mass, depending on if and how it was moving already, depending on its physics. It will build up speed, and lose speed depending on the damping (linear damping).
Velocity is cold math. Changing velocity will instantly change the objects movement. Not counting in forces that was already there. Not counting in inertia. That is impossible in the real world.
16/set angular velocity.
More of the same to make an object rotate.
Next post about physic's properties that can be used in an expression.