Recent Forum Posts
From categories:
page 1123...next »
Explosions
FurballFurball 1257584036|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Explosions

How would you go about setting up explosions, where you can vary the size and other things and have it semi realistically displace the objects around it?

Explosions by FurballFurball, 1257584036|%e %b %Y, %H:%M %Z|agohover
Re: Character - Change moviment style
Thiago (guest) 1257537870|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character - Change moviment style

"Well if you're using the experimental character code that noone posted on the codeplex site, it rotates the player to match the camera's rotation every frame."

where ?? i downloaded this
javascript:window.location.href='http://jiglibx.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=64482';
in http://www.codeplex.com/JigLibX

and the there is just a force being aplied to it

 Matrix cameraRotation = Matrix.CreateRotationX(camera.Angles.X) *
                    Matrix.CreateRotationY(camera.Angles.Y);

                moveVector = Vector3.Transform(moveVector, cameraRotation);

                JiggleMath.NormalizeSafe(ref moveVector);
                moveVector *= amountOfMovement;

                character.CharacterBody.DesiredVelocity = moveVector;

                if (keyState.IsKeyDown(Keys.Space))
                    character.CharacterBody.DoJump();

No Rotation, just a Force !!!

I want something like this;
i push left in the keyboard and the character rotate, he stay stopped (no spacial movimentation), he just move his "look at", and whe i push up, hw will move ahead (the new rotated front)
Like the mouse movement in Counter Strike

someone has already done this ?

Thanks again in advance

Re: Character - Change moviment style by Thiago (guest), 1257537870|%e %b %Y, %H:%M %Z|agohover

E.G. if the ball is on the left edge which is lower down than the right, plane is then rotated to life the left side up however the sphere does not follow this movement and instead remains stationary.

I had a similar problem with a ball rolling on a mesh, when I rotated the mesh the ball did not roll down.
Instead of CollisionSkin.ApplyLocalTransform(Transform transform), I used this instead:

        public void ApplyLocalTransformAbsolute(Transform transform)
        {
            for (int prim = primitivesNewWorld.Count; prim-- != 0; )
            {
                //t = primitivesLocal[prim].Transform;
                primitivesLocal[prim].Transform = transform;
            }

            SetTransform(ref transformOld, ref transformNew);
        }

Don't know if it will fix a similar problem with boxes though.
Re: Moveable box - Objects falling through by ArdmarkArdmark, 1257522558|%e %b %Y, %H:%M %Z|agohover

are you using the SphereObject.cs from jigglegame?

the thing that throws me off is that your getting no rotation on the ball.

are you working in a empty scene? like just the box and the sphere? its possible that your not removing some collisions out from the example project and the ball is colliding with those. i'm really not sure why this would happen other than that or some messed up values in the physics system.

if you don't have any rotation make sure that your inertia matrix values for the sphere's body are non zero. They shouldnt be if you're calling SetMass inside the sphereobject.cs

Re: Moveable box - Objects falling through by PGlynnPGlynn, 1257468044|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Mojo (guest) 1257458346|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

I've tried out the suggestions you made and the sphere still fails to roll on the plane.

The box, no matter how thick, doesn't like changing rotation direction and so the sphere falls through it still when its rotation is changed to opposite way in which the sphere is moving.

Re: Moveable box - Objects falling through by Mojo (guest), 1257458346|%e %b %Y, %H:%M %Z|agohover

try taking the in game rotation adjustment out and creating the plane on with (instead of Vector3.Up) Vector3.Transform(Vector3.Up, Matrix.CreateRotationX(0.0001f))

see if rolling occurs without applying local transform. It might be that the plane primitive just doesnt like transforms.

also you might want to try going back to a box on a immoveable body if thats the case. just make sure your box is thick.

Re: Moveable box - Objects falling through by PGlynnPGlynn, 1257455354|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Mojo (guest) 1257444735|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through
public Floor(Game game, Model model, float d)
            : base(game, model)
        {
            body = new Body();

            collision = new CollisionSkin(null);
            collision.AddPrimitive(new JigLibX.Geometry.Plane(Vector3.Up, d), new MaterialProperties(0.2f, 0.7f, 0.6f));
            PhysicsSystem.CurrentPhysicsSystem.CollisionSystem.AddCollisionSkin(collision);

            body.ApplyGravity = false;

        }

        public override void ApplyEffects(BasicEffect effect)
        {
            effect.DiffuseColor = new Vector3(200.0f,0.0f,0.0f);
        }

        public void rotate(int direction)
        {

            if (direction == 1)
            {
                Matrix rotation = this.PhysicsBody.Orientation;
                Vector3 position = this.PhysicsBody.Position;

                rotation *= Matrix.CreateRotationX(0.0001f);
                this.PhysicsBody.MoveTo(position, rotation);

                this.PhysicsSkin.ApplyLocalTransform(new Transform(Vector3.Zero, Matrix.CreateRotationX(0.0001f)));

            }          
        }
}

This is the code i'm using to create the floor as a plane (there are another 3 movement directions i've left out as they are the same as the 1st), however it's now experiencing a problem whereby the sphere will land on the plane and when the planes rotation is changed the ball will drop down onto this lower place but not roll. Is this due a force needing to be applied in order to make the sphere roll?

Also when the plane is rotated the other way the sphere will not move up the plane, it simply falls through it. E.G. if the ball is on the left edge which is lower down than the right, plane is then rotated to life the left side up however the sphere does not follow this movement and instead remains stationary.

Any ideas?

Re: Moveable box - Objects falling through by Mojo (guest), 1257444735|%e %b %Y, %H:%M %Z|agohover
Re: Character - Change moviment style
Nic (guest) 1257433219|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character - Change moviment style

Well if you're using the experimental character code that noone posted on the codeplex site, it rotates the player to match the camera's rotation every frame. Did you comment that code out? If not it would stomp any changes you're trying to make to the player's rotation.

Re: Character - Change moviment style by Nic (guest), 1257433219|%e %b %Y, %H:%M %Z|agohover
Character - Change moviment style
Thiago (guest) 1257427515|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character - Change moviment style

i tried everything, aplying Torque, changing angular speed … but no success
anyone knows how to done this.
i just want the character to rotate a little when i click left or right.
some light pls

thank you in advance.

Character - Change moviment style by Thiago (guest), 1257427515|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Mojo (guest) 1257368035|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

I also tried to use

this.PhysicsSkin.NewTransform = new Transform(position, rotation);

however it claims it is read only

Re: Moveable box - Objects falling through by Mojo (guest), 1257368035|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Mojo (guest) 1257367410|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

Even when using the new code you suggested the sphere is still falling through the plane when the rotation direction is changed quickly, for example when its rolling to one way on the plane, when the plane is then rotated the ball will begin to fall into the plane and then fall out the bottom of it if it has dropped too far.

Re: Moveable box - Objects falling through by Mojo (guest), 1257367410|%e %b %Y, %H:%M %Z|agohover

actually the PhysicsBody is not tied to the collision at all.

instead of using MoveTo on the PhysicsBody use this

Matrix rotation = PhysicsSkin.NewTransform.Orientation;
Vector3 position = PhysicsSkin.NewTransform.Position;

rotation *= Matrix.CreateRotationX(0.0001f);

this.PhysicsSkin.NewTransform = new Transform(position, rotation);

or if your just wanting to rotate the skin like in the function above

this.PhysicsSkin.ApplyLocalTransform(new Transform(Vector3.Zero, Matrix.CreateRotationX(0.0001f)));
Re: Moveable box - Objects falling through by PGlynnPGlynn, 1257365093|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Nic (guest) 1257364950|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

I'm more experience with Havok than JiglibX, in Havok objects resting on a mesh would not be affected by that meshes movement unless velocity was applied. Simply changing the position would not work. Are you rotating the plane by setting its orientation, or be applying an angular velocity?

Re: Moveable box - Objects falling through by Nic (guest), 1257364950|%e %b %Y, %H:%M %Z|agohover
Re: Moveable box - Objects falling through
Mojo (guest) 1257362774|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

I'm now trying to use a modified plane to carry it out as suggested, using the planeobject.cs with rotation code added in using

Matrix rotation = this.PhysicsBody.Orientation;
Vector3 position = this.PhysicsBody.Position;

rotation *= Matrix.CreateRotationX(0.0001f);
this.PhysicsBody.MoveTo(position, rotation);

to move it in the X axis.

I need to set the body to immovable as otherwise the sphere falls through it, however when the ball is sat ontop of the plane any changes to the planes angle are not affected in the sphere. This means the ball just stays on the first point and won't move when the plane rotates. I assume this is to do with collision skins not updating on the plane?

Re: Moveable box - Objects falling through by Mojo (guest), 1257362774|%e %b %Y, %H:%M %Z|agohover

yea i agree with nic, if your trying to use a triangle mesh for a large surface you'll notice alot of hiccups. the heightmap approach is alot more solid.

Re: Jittering with custom DetectFunctor by PGlynnPGlynn, 1257354885|%e %b %Y, %H:%M %Z|agohover

yea unfortunatly boxes are iffy with collisions. More so with smaller scaled or thin boxes. Take a look at this post here : http://jiglibx.wikidot.com/forum/t-188737/lower-scaled-primitives-cause-jittery-physics-against-other-primitives.

It sounds like since you move the immovable you wake up everything ontop of it or touching.

If possible, try using a plane instead. you'll notice much more solid collisions.

also you probably shouldnt use a body with a plane. You can use the collision skin alone and then use newposition and neworientation in the collision skin to transform it. Take a look at planeobject.cs in jigglegame to see how to create a collision skin without body. ( note : theres a body constructed there in the .cs but its not actually used for physics. )

Re: Moveable box - Objects falling through by PGlynnPGlynn, 1257354638|%e %b %Y, %H:%M %Z|agohover
Re: Character controller issue
PGlynnPGlynn 1257354456|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character controller issue

what is the ground? mainly what primitive.

Re: Character controller issue by PGlynnPGlynn, 1257354456|%e %b %Y, %H:%M %Z|agohover
Moveable box - Objects falling through
Mojo (guest) 1257342843|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Moveable box - Objects falling through

I'm currently trying to make a box act as the floor for a game, with the user being able to rotate this box in the x and z axis to move the objects that are on the box.

As it stands the box is able to rotate fine, however when the rotation direction is changed the objects sat on the top of it begin to move through the box. The box is set to immovable and the physics body is rotated as the box is rotated so i don't know what it could be.

Any ideas?

Thanks

Moveable box - Objects falling through by Mojo (guest), 1257342843|%e %b %Y, %H:%M %Z|agohover
Re: Character controller issue
Nic (guest) 1257303070|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character controller issue

Ok, the inertia code was being overwritten, I placed it in the wrong place, so that is preventing the capsule from falling over. However, I still have a strange issue where when the capsule is bumped by any other physics, it starts floating above the ground and goes straight up into the sky, seemingly ignoring gravity entirely. Any ideas?

Re: Character controller issue by Nic (guest), 1257303070|%e %b %Y, %H:%M %Z|agohover
Re: Character controller issue
Nic (guest) 1257294391|%e %b %Y, %H:%M %Z|agohover
in discussion General / Help » Character controller issue

Yes, that did nothing for me. However, I'll double check, maybe my engine is also setting inertia sometime after that.

Thanks.

Re: Character controller issue by Nic (guest), 1257294391|%e %b %Y, %H:%M %Z|agohover
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License