notgiven688 / jitterphysics2 Goto Github PK
View Code? Open in Web Editor NEWFast, simple, and dependency-free physics engine written in C# with a clear and user-friendly API.
License: MIT License
Fast, simple, and dependency-free physics engine written in C# with a clear and user-friendly API.
License: MIT License
When the transform of an entity changes, is it possible to provide a callback function so that the transform of the corresponding entity in the game can be modified?
What I do now is: traverse every entity in the physical world every frame, find the corresponding game entity through Tag, and then modify the transform
It seems my rotated models are appearing different than the collision shapes in Jitter. Here is how I'm converting them:
public static JMatrix ToJMatrix(this Matrix matrix) { return new JMatrix( matrix.M11, matrix.M12, matrix.M13, matrix.M21, matrix.M22, matrix.M23, matrix.M31, matrix.M32, matrix.M33 ); }
Is this correct?
I'm then creating a transformedshape:
TransformedShape tfs1 = new(boxShape, center,rotationMatrix.ToJMatrix());
I'm using JitterPhysics on my toy game engine, it is awesome.
When using rigidbody with shape and raycast, if I can see the position of rigidbody/shape or the path of raycast, you can troubleshoot errors more intuitively.
For rays, if the path can be seen, it can also be clear in what state (such as rotation) the shape is detected.
To use jitter2 on the server
I want to receive the character's movement from the client.
So, on the server, I want to handle the character's rigid body as kinematic. How can I do this?
Check out the docs for IBroadPhaseFilter
:
It says <returns>False if the collision should be filtered out; true otherwise.</returns>
.
However, when setting a filter, if I return true
it doesn't do collision, but if I return false
, the objects do collide.
IMO the correct behavior is according to docs, ie true = collide, false = don't collide.
It makes more sense that way. But whatever you choose please make it consistent with the comment.
Thanks!
There is JConvexHull.Build function in jitterphysics1 that can do it. How should it be done in jitterphysics2?
Usually Mass = 0 means static objects.
If Mass of zero is not supported, its best to throw exception immediately upon setting it.
But IMO its better to support it and not generate NaNs.
Hello,
Aside for this issue #53 , the damping values themselves are also seems to be reversed.
This means that damping value of 0 completely stop the objects from moving (what should happen with damping value of 1) while damping value of 1 actually let the objects move forever (what should happen with 0).
In other words, I need to set damping like this in order for it to behave like in other physics simulators:
rigidBody.Damping = (1f - actualLinearDamping, 1f - actualAngularDamping);
Is that intentional? I checked with few other engines and there seems to be a consensus that 0 = no damping, 1 = 100% damping, and sometimes negative value increase movement.
Thanks!
I really want to use this in Unity but targeting at .Net 7 with C# > 7 makes it impossible. Jitter physics v1 works perfectly, is there any way you could make it compatible too?
Check out this setter:
The setter call first param angular
and second param linear
, but when setting the values it set linear
as first and angular
as second, flipping them.
Looks like a mistake.
Also please add individual setter / getter for damping types. Thanks!
Transform all vertices and reconstruct the shape?
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.