Search found 249 matches
- Sat Sep 15, 2012 10:33 pm
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
Re: CompoundBody centre is not central?
I thought that at first but it turns out I require Collision Mesh entity.CollisionInformation.LocalPosition = entity.Position - (voxelMesh.PivotPoint * ScaleFactor); Model voxelMesh.WorldTransform = Matrix.CreateTranslation(-voxelMesh.PivotPoint) * Matrix.CreateScale(ScaleFactor) * entity.WorldTrans...
- Sat Sep 15, 2012 8:40 am
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
Re: CompoundBody centre is not central?
In that case the model must have its own special transform to match the entity. I cannot simply have voxelMesh.WorldTransform = Matrix.CreateScale(ScaleFactor) * entity.WorldTransform; The above only works when using the true centre of mass as the LocalPosition offset entity.CollisionInformation.Loc...
- Fri Sep 14, 2012 8:22 pm
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
Re: CompoundBody centre is not central?
So how do I incorporate the LocalPosition into the final transformed position (world space) Should I translate the local shape transformation vertices by the offset? private void DrawWireFrame(GameTime gameTime) { CompoundBody body = entity as CompoundBody; TriangleShape tri; Vector3 v0; Vector3 v1;...
- Fri Sep 14, 2012 11:37 am
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
Re: CompoundBody centre is not central?
I think another problem lies with my wireframe representation. private void DrawWireFrame(GameTime gameTime) { CompoundBody body = entity as CompoundBody; TriangleShape tri; Vector3 v0; Vector3 v1; Vector3 v2; int numShapes = body.Shapes.Count; for (int i = 0; i < numShapes; ++i) { tri = body.Shapes...
- Thu Sep 13, 2012 8:39 pm
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
Re: CompoundBody centre is not central?
Not sure I follow what you are saying. Both of the following have the same effect entity.CollisionInformation.LocalPosition = entity.Position; //entity.CollisionInformation.LocalPosition = voxelMesh.PivotPoint; with voxelMesh.WorldTransform = Matrix.CreateScale(ScaleFactor) * entity.WorldTransform; ...
- Thu Sep 13, 2012 2:14 pm
- Forum: Questions and Help
- Topic: CompoundBody centre is not central?
- Replies: 12
- Views: 6475
CompoundBody centre is not central?
I'm creating a CompoundBody from a list of indices and vertices which gives me a local offset for the final entity. Vector3[] vertices = voxelMesh.Vertices; int[] indices = voxelMesh.Indices; int numIndices = indices.Length; int numTriangles = vertices.Length; var scaleTransform = Matrix.CreateScale...
- Fri Sep 07, 2012 10:09 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
Re: GravitationalField multiplier & space gravity do not equ
I'll work on something tomorrow then and see if I can isolate it after some sleep.
- Fri Sep 07, 2012 9:23 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
Re: GravitationalField multiplier & space gravity do not equ
In this case there are too many separate classes involved in order to isolate and rewrite.
Can I send you a zipped file of the current source? It will include the 2 scenarios shown in the video along with the custom meshes.
Can I send you a zipped file of the current source? It will include the 2 scenarios shown in the video along with the custom meshes.
- Fri Sep 07, 2012 8:48 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
Re: GravitationalField multiplier & space gravity do not equ
I've uploaded two videos to demonstrate The first video shows the objects influenced by Space.Gravity (0, -10, 0) http://youtu.be/V51vRNmzOrw The second video shows the objects influenced by the individual gravitational fields (the vector field shapes are shown as a white wireframe) http://youtu.be/...
- Fri Sep 07, 2012 7:43 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
Re: GravitationalField multiplier & space gravity do not equ
When switching to GravitationalFieldAcceleration.Constant (even when changing r to Vector.UnitY) the behaviour is still not the same as under gravity. protected override void CalculateImpulse(Entity e, float dt, out Vector3 impulse) { switch (AccelerationType) { case GravitationalFieldAcceleration.C...
- Fri Sep 07, 2012 6:27 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
Re: GravitationalField multiplier & space gravity do not equ
Is it possible to override the impulse calculation stage and apply a linear impulse?
Forcefield CalculateImpulse method doesn't appear as it is protected:
Forcefield CalculateImpulse method doesn't appear as it is protected:
Code: Select all
protected abstract void CalculateImpulse
- Fri Sep 07, 2012 2:32 pm
- Forum: Questions and Help
- Topic: GravitationalField multiplier & space gravity do not equate?
- Replies: 10
- Views: 6727
GravitationalField multiplier & space gravity do not equate?
I'm creating a GravitationalField with a custom shape for the vector field. gravField = new GravitationalField( localSettings.ForceFieldShape.Load(game, this), localSettings.Position, localSettings.GravitationalFieldStrength, 30 ); If I remove all the gravity from the physics space (0, 0, 0) and set...
- Wed Jul 25, 2012 4:17 pm
- Forum: Questions and Help
- Topic: Significant drop in frame rate on very first collision?
- Replies: 12
- Views: 7412
Re: Significant drop in frame rate on very first collision?
Brilliant. Thanks for the info
- Wed Jul 25, 2012 7:27 am
- Forum: Questions and Help
- Topic: Significant drop in frame rate on very first collision?
- Replies: 12
- Views: 7412
Re: Significant drop in frame rate on very first collision?
Just calling the following fixes the problem: JITCompilation.PreJITMethods(System.Reflection.Assembly.LoadFrom("BEPUphysics.dll")); It doesn't appear to require anything else?! Calling the preJIT from within the ForceLoadAll method will help with this. Can you please post what code you use...
- Tue Jul 24, 2012 11:49 pm
- Forum: Questions and Help
- Topic: Significant drop in frame rate on very first collision?
- Replies: 12
- Views: 7412
Re: Significant drop in frame rate on very first collision?
Cool, thank you for clearing that up. :) Could you possibly explain how to avoid certain classes in the assembly? There is a problem stated on the website: (Remark: it should be noted that calling PrepareMethod may trigger the static constructor of the destination type, that is, if it has one). This...