notgiven688 / jitterphysics Goto Github PK
View Code? Open in Web Editor NEWA cross-platform, realtime physics engine for all .NET apps.
License: MIT License
A cross-platform, realtime physics engine for all .NET apps.
License: MIT License
The transformation of game objects usually involves displacement, scaling and rotation. The displacement is RigidBody.Position, the rotation is RigidBody.Orientation.
I think the sample in XNA provided current is a little complex.
Can provide some simple sample just to show how to move and rotate control
according to mouse event in the world and detect collision?
In Winform or WPF will also be OK.
Thanks.
Original issue reported on code.google.com by [email protected]
on 20 Dec 2012 at 3:19
What steps will reproduce the problem?
1. Place cubes on top of each other (tightly) lying directly on the floor.
2. Run simulation
What is the expected output? What do you see instead?
Structure should be stable, but instead it "jiggles" and collapses.
https://youtu.be/Lw0G0a7tphk
What version of the product are you using? On what operating system?
Latest version from svn with OpenTK on Win7
Please provide any additional information below.
Step is done like this:
world.Step((float)milliseconds / 1000, _worldSimulationMultiThread, 1f / 60f, 2);
All other properties of RigidBody and Material are default.
Original issue reported on code.google.com by [email protected]
on 27 Jul 2015 at 12:42
What can I do to port this implementation?
http://wiki.unity3d.com/index.php?title=DontGoThroughThings
Project abandoned?
Is it possible to Save/Load world state? I tried to save some vectors and restore them later, but seems i missed something, so i am unable to restore state properly.
Hi,
I'm following the wiki and when I create and add the body to the world I can't find the method to draw it. I wrote this method (that already contains the call to draw Box)
protected override void OnBeginRender(double elapsedTime)
{
foreach (RigidBody body in world.RigidBodies)//for every rigid body in the world
{
if (body.Shape is BoxShape)
{
BoxShape shape = body.Shape as BoxShape;
dsDrawBox(body.Position, body.Orientation, shape.Size);
}
else if(body.Shape is CompoundShape)
{
CompoundShape shape = body.Shape as CompoundShape;
//What is the method to call here? In the library there isn't dsDrawCompoundShape(...)
}
}
world.Step(1.0f / 100.0f, true);
}
Thakyou for the help.
I have a scene that a ray doesn't go cross a cube, but the raycast method say yes.
When move the ray origin position along the direction, the raycast even get different result.
is here a way to get a list of all colliding objects with a rigidbody? I cant find any docs, and no luck in experimentation.
- What steps will reproduce the problem?
1. Just create a single body constraint,
2. call world.AddConstraint(..),
3. and get an instant NullReferenceException.
- What version of the product are you using?
The latest from the repository.
- Please provide any additional information below.
NullReferenceException: Object reference not set to an instance of an object
Jitter.Collision.IslandManager.AddConnection (IslandManager.cs:169)
Jitter.Collision.IslandManager.ConstraintCreated (IslandManager.cs:61)
Jitter.World.AddConstraint (World.cs:499)
IslandManager.AddConnection(RigidBody body1, RigidBody body2) doesn't expect
body2 to be null.
Original issue reported on code.google.com by [email protected]
on 24 Jun 2013 at 7:31
The issue is that the normals calculations are incorrect, and cause triangle model lighting to be completely mangled. The problem lines are right here:
And the issue can be fixed by changing the selected lines above to:
when run the demo
new Game() threw an exception of type 'System.NummReferenceException'.
MonoGame.Framework, Version=3.6.0.1625
collider with high speed can penetrate the collider
Please add Nuget package.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2012 at 6:18
Comments said:
/// <summary>
/// Raycasts a single body. NOTE: For performance reasons terrain and
trianglemeshshape aren't checked
/// against rays (rays are of infinite length). They are checked against
segments
/// which start at rayOrigin and end in rayOrigin + rayDirection.
/// </summary>
But really, for CompoundShape it works similar.
/// <param name="rayOrigin"></param>
/// <param name="rayEnd"></param>
/// <returns></returns>
public override int Prepare(ref JVector rayOrigin, ref JVector rayEnd)
{
JBBox box = JBBox.SmallBox;
box.AddPoint(ref rayOrigin);
box.AddPoint(ref rayEnd);
return this.Prepare(ref box);
}
Workaround - make long rays.
Something like raydir*100.
Original issue reported on code.google.com by [email protected]
on 17 Mar 2013 at 2:50
I searched for height field but didn't find it. So is there a height field implementation in jitterphysics?
BTW, is the jitterphysics website down? http://www.jitter-physics.com/
No text.
Hi, I'm running the physics on a Windows Form application. The application is just a server, so it doesn't need to render any game object. It just calculates the positions and collisions then sends the numbers to the clients, who will render the objects.
As we all know, every game API or engine has an Update() method. However, I'm not sure where to call world.Step() on a Windows Form app.
Currently, I'm using a System.Timers.Timer object, and trying different intervals. But the physics behaviour looks weird depending on the interval value.
In my server, so far, I have just a bouncing ball and a ground.
At 1 ms, the ball often doesn't bounce when hitting the ground.
At 15 ms, the ball often doesn't bounce, and it seems slower.
At 30 ms, the ball bounces with a force lower than expected.
The time step call happens at every clock tick, as the following:
Step(1.0f / 100.0f, false);
When and how often should I call Step() on a Windows Forms app?
inisde CollisionSystemPersistentSAP.DirtySortAxis it will do a exact intersection test when two are potentially intersected, or I overlook something?
thanks
Thanks for this great library.
I'm building a game server with Jitter physics. The clients receive the objects' transform information from the server.
I don't know how to make an object on Unity match the size of its related Jitter rigidbody. For example: my sphere on the server has 0.5 radius. On Unity, the sphere object that receives its transform information also has 0.5. It SEEMS to match the dimension on the server, but I'm not sure, and it's hard to debug that. Is there an exact formula or anything like that?
I created two accounts on the forums but both times I created the accounts I
received an "Internal Server Error" and never received a confirmation email.
Therefore I cant login because it wont let me confirm.
If someone has control of the forum member records please either delete my
accounts or resend my confirmation emails.
Account names:
cha55son
wrinkles88
Original issue reported on code.google.com by [email protected]
on 30 Aug 2011 at 2:58
I would like to disable rotation for some objects, is it possible?
Could you translate this physics engine Unity3d compatible??
Original issue reported on code.google.com by [email protected]
on 5 Apr 2012 at 5:44
I have 2 rigidbodies in my world: a ball (with a sphere shaped rigidbod), and a player (with a cylinder shaped rigidbody).
The player follows the mouse pointer and sets the location of its rigidbody (I know that setting the rigidbody position this way isn't a good practice).
The player's rigidbody is static.
When the player touches the ball, it's able to move it. But when the ball is not moving (0 velocity), the player doesn't affect the ball, it penetrates it.
I tried setting the isStatic property of the player's rigidbody to false, the same thing happened.
What's going on and how can I solve it?
//player's body
playerBody = new RigidBody(cylinder);
playerBody.IsStatic = true;
//ball's body
ball = new RigidBody(sphere);
Also, to make the ball slow down and simulate friction with the ground, I'm using the following line:
ball.AngularVelocity *= 0.5f;
Just what it says,
My code for ray detection is:
` public DetectTest(Character info, Vector3 forward)
{
JVector hitNormal;
float fraction;
bool result;
JQuaternion rot = JQuaternion.CreateFromMatrix(info.bodyJitter.Orientation);
JVector rotVector = new JVector(rot.X, rot.Y, rot.Z);
JVector basePos = info.bodyJitter.Position;
result = Program.jitterPhysics.world.CollisionSystem.Raycast(basePos + new JVector(forward.x / .5f,
forward.y / .5f, forward.z / .5f),
new JVector(rot.X, rot.Y, rot.Z),
RaycastCallback,
out resBody,
out hitNormal,
out fraction);
this.result = result;
if (resBody != null)
{
Console.WriteLine(resBody.Position);
}
//Console.WriteLine(result ? "Hitted something!" : "No hit detected!");
}`
I guess your .gitignore didn't let you push that file:
*.obj
I took the one from HACD folder. But still couldn't compile anything on VS 2012.
Jitter.Portable won't recognize the System namespace.
When switching it with Jitter, JitterDemo won't recognize "Xna" in Microsoft namespace.
I'm new to monogame, so I'm going back to pure XNA for now.
I suggest a clean test from a git pull to check whether the issue is in my system or in repo.
Hi, I'm wondering whether there's any information about what's "not complete" in this Jitter Physics 2D port? I'm currently trying to find an alternative to Farseer due to its lack of support for multiple cores and efficient compound shapes.
Thanks!
Any way to support kinematic bodies, thinks
Because of my upstream game engine only supports .net 2.0, is there any plan to
provide support for it?, as in jitter i can see it heavily using lingq.
Original issue reported on code.google.com by [email protected]
on 24 Jan 2012 at 8:37
/// <summary>
/// Transforms a vector by the transposed of the given Matrix.
/// </summary>
/// <param name="position">The vector to transform.</param>
/// <param name="matrix">The transform matrix.</param>
/// <param name="result">The transformed vector.</param>
public static void TransposedTransform(ref JVector position, ref JMatrix matrix, out JVector result)
{
float num0 = ((position.X * matrix.M11) + (position.Y * matrix.M12)) + (position.Z * matrix.M31);
float num1 = ((position.X * matrix.M21) + (position.Y * matrix.M22)) + (position.Z * matrix.M23);
float num2 = ((position.X * matrix.M31) + (position.Y * matrix.M32)) + (position.Z * matrix.M33);
result.X = num0;
result.Y = num1;
result.Z = num2;
}
Bug at first line.
Must be:
... + (position.Z * matrix.M13);
Original issue reported on code.google.com by [email protected]
on 7 Jan 2013 at 5:39
Hi,
Just wondering if this physics engine is deterministic, at least on same
platform???
Thanks!
Original issue reported on code.google.com by [email protected]
on 27 Mar 2015 at 3:46
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.