Hey all. Having a great time with JigLibX, put me way behind on my planned project cause I am having too much fun just setting scenes and watching collisions. (Yes I am sane)
Quick question about making and object 'immovable' but 'movable' if that makes sense.
Let me explain.
Think a solid brick wall that can be moved around by user input. Now I am not sure how to set it up so that the collisions occur semi-properly.
The brick wall is not being moved by force, but rather its position being updated by the position of the left analogue stick on a controller. (ie hold the stick 75% left the brick wall will hold a position somewhere along the x axis, let it go and it will return to Vector3.Zero)
Now in order to achieve this I think I must have…..
ApplyGravity = false; //don’t want the wall falling down ever, nor attached to ground
Immovable = false; // must be moveable so we can move it.
Now the problem and I guess question comes when I throw a ball up against the brick wall, the ball is being moved by AddBodyForce; in its controller.
But if BrickWall.Immovable and BrickWall.ApplyGravity both = false; then the BrickWall is sent into a spin by the ball.
So what is the correct way to make the brick wall moveable by the user but immovable by a collision with an object such as the ball?
At the moment I am using the work around solution of …
bool BrickWallSkin_callbackFn(CollisionSkin skin0, CollisionSkin skin1)
BrickWall.Immovable = true;
//and then setting BrickWall.Immovable = false again.
However this has obvious limitations and inconsistencies when it comes to the collision as the brick wall is updated regularly by the user input which can result in undetected collisions, or if the user moves the wall towards the ball the wall may move in front of the ball after collision.
I am sure there is an easy fix
Any Ideas on how to do this would be much appreciated.
Thanks in advance.