Search found 92 matches
- Sun May 10, 2015 5:37 am
- Forum: Questions and Help
- Topic: World Location to Entity-centered Local Position
- Replies: 3
- Views: 3736
World Location to Entity-centered Local Position
Let's say I have a point in world space. This point is roughly 3 units to the left of a box. I want to get this point's "local" point relative to the box. (EG, (3,0,0)) I want to then render something at that local point. That way, if the entity moves or rotates, the point stays at the cor...
- Tue May 05, 2015 3:47 am
- Forum: Questions and Help
- Topic: Lock an entity to a plane
- Replies: 3
- Views: 4055
Re: Lock an entity to a plane
Having the same body for both parameters won't work, but you can pass null in for the first parameter for both constraints. When null is passed into a two entity constraint as a connection, the constraint connects to a kinematic 'world' entity. That sets Position.Z = ~20 and Velocity.Z = -110 consi...
- Mon May 04, 2015 11:02 pm
- Forum: Questions and Help
- Topic: Lock an entity to a plane
- Replies: 3
- Views: 4055
Lock an entity to a plane
I'm trying to lock certain entities into a 2D environment TheClient.PhysicsWorld.Add(Body); popj = new PointOnPlaneJoint(Body, Body, new Vector3(0, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 0, 0)); TheClient.PhysicsWorld.Add(popj); raj = new RevoluteAngularJoint(Body, Body, new Vector3(0, 0, 1)); ...
- Mon May 04, 2015 8:50 pm
- Forum: Questions and Help
- Topic: Forcibly deactivating an entity
- Replies: 1
- Views: 3080
Forcibly deactivating an entity
I'm working on client/server sharing physics, and I want to make it so if the server says an entity is deactivated, then it deactivates on the client as well. There's a variety of reasons for this that aren't incredibly relevant to the discussion. Basically: - The entity must stop moving / calculati...
- Mon Apr 27, 2015 11:57 pm
- Forum: Questions and Help
- Topic: Rendering a complex model that exists as a physics object
- Replies: 3
- Views: 3652
Re: Rendering a complex model that exists as a physics objec
So I figured out what was actually happening... the clientside representation of the object had a mass of 0, while the serverside had a mass of 100. It was rendering fine, just the entity itself was rotating weirdly. The server sends updates every tick on the position/velocity/angle/angular_velocity...
- Mon Apr 27, 2015 10:03 pm
- Forum: Questions and Help
- Topic: Rendering a complex model that exists as a physics object
- Replies: 3
- Views: 3652
Rendering a complex model that exists as a physics object
So, I got cuboids (boxes) rendering /perfectly/ thanks to previous posts. They rotate correctly and all. I'm now trying to handle a complex model generated from a file. The origin of the model is at the model's bottom, and obviously that's not where the center of mass is, so I record the offset gene...
- Tue Apr 21, 2015 12:44 am
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Re: Prevent Entities From Entering Each Other
Okay so public OpenTK.Matrix4 GetOrientationMatrix() { Matrix3x3 omat = Body.OrientationMatrix; omat.Transpose(); Matrix mat = Matrix3x3.ToMatrix4X4(omat); return new OpenTK.Matrix4(mat.M11, mat.M12, mat.M13, mat.M14, mat.M21, mat.M22, mat.M23, mat.M24, mat.M31, mat.M32, mat.M33, mat.M34, mat.M41, m...
- Mon Apr 20, 2015 10:52 pm
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Re: Prevent Entities From Entering Each Other
When I just do mat.transpose();
I get this:
There's no way it's just a transpose. I don't have the slightest clue what's going on or what to do about it.
I get this:
There's no way it's just a transpose. I don't have the slightest clue what's going on or what to do about it.
- Mon Apr 20, 2015 8:06 pm
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Re: Prevent Entities From Entering Each Other
Neither .transpose() nor .inverted() (OpenTK method) return anything remote useable. Invert puts everything backwards, transpose produces... I'm not sure what, just everything is way off. Switching columns/rows around manually also produces pure nonsense. Matrix4 mat = GetTransformationMatrix() * Ma...
- Sun Apr 19, 2015 11:53 pm
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Re: Prevent Entities From Entering Each Other
Welp... you're right, that didn't fix it. It just made it less common if anything at all. The box is a box prefab. Gravity is 0,0,-9.8 Trying to replicate on the demos now... Actually, the physics going on in the demo just looks straight... different from what I see in my creation. Am I perhaps rend...
- Sun Apr 19, 2015 6:15 am
- Forum: Suggestions
- Topic: Per-Entity Gravity
- Replies: 3
- Views: 22784
Per-Entity Gravity
It'd be pretty neat if we could specify a gravity vector on each entity rather than in the Space. A simple way to accomplish this in a non-changing manner would be to use something along the lines of a Nullable<Vector3> -> if it's null, use Space.Gravity, otherwise, use the value input. In theory, t...
- Sun Apr 19, 2015 6:02 am
- Forum: Questions and Help
- Topic: Per-Entity Gravity
- Replies: 3
- Views: 3996
Re: Per-Entity Gravity
ApplyLinearImpulse which does not force activation (but which would require scaling the acceleration by the object's mass) Uhm... it does? I'm used ApplyImpulse for a few things (Rather than ApplyLinearImpulse for my own stupid reasons) and it definitely does not expect scaling by mass. I actually ...
- Sun Apr 19, 2015 5:57 am
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Re: Prevent Entities From Entering Each Other
I did actually assume 1 unit = 1 meter. That box is 1x1x1. However, CollisionDetectionSettings.AllowedPenetration = 0.001f; and now I can't replicate it at all :D In addition, my character is no longer inside the floor. I never bothered posting about that as Bullet had me used to it, but it's nice t...
- Sun Apr 19, 2015 2:46 am
- Forum: Questions and Help
- Topic: Prevent Entities From Entering Each Other
- Replies: 11
- Views: 7631
Prevent Entities From Entering Each Other
Is there any way to ensure entities will never enter each other, even partially? Generally it's not a problem, but sometimes I get some weird results, EG today a box landed as shown below after a tumbling fall https://i.imgur.com/MkFxneW.png If you can't tell from the image, it's partially inside th...
- Sat Apr 18, 2015 9:43 pm
- Forum: Questions and Help
- Topic: Get The Entity Hit By A ConvexCast
- Replies: 1
- Views: 2808
Get The Entity Hit By A ConvexCast
I performed Space.ConvexCast(...) and have a RayCastResult. How do I get the Entity impacted? The 'HitObject' merely returns a BroadPhaseEntry, which appears to have no Entity property.
EDIT: Oh, and thanks for the quick and helpful answers to my previous questions
EDIT: Oh, and thanks for the quick and helpful answers to my previous questions