<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>JigLibX - new forum threads</title>
		<link>http://jiglibx.wikidot.com/forum/start</link>
		<description>Threads in forums of the site &quot;JigLibX&quot; - The XNA C# Collision and Physics Solution</description>
				<copyright></copyright>
		<lastBuildDate></lastBuildDate>
		
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-200494</guid>
				<title>HingeJoint Question</title>
				<link>http://jiglibx.wikidot.com/forum/t-200494/hingejoint-question</link>
				<description></description>
				<pubDate>Sun, 29 Nov 2009 00:46:04 +0000</pubDate>
				<wikidot:authorName>DevanDanger</wikidot:authorName>				<wikidot:authorUserId>362271</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm using a controller which is based on the hinge joint since I need some custom body force/torque added through user input. I have all of the input working correctly to created rotations around this constraining body. The only problem I'm having is that I want to be able to move the constraining (body0) body subsequently moving the controlling body (body1) around while still constraining its relative position/rotations.</p> <p>I'm getting close to the action I want however while moving the constraining body it causes a temporarily shake to the controlled body. I'm looking for way to prevent this. Any thoughts?</p> <p>Can post a video to explain better if needed.<br /> Also this is how I'm moving the constraining body, I'm assuming I should be doing this differently. Experimented a couple of ways to no avail.</p> <p>this.ConstrainedBody.Position = this.ConstrainedBody.Position += new Vector3(0, 0, .01f);</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-200312</guid>
				<title>Collisions at origin? Why?</title>
				<link>http://jiglibx.wikidot.com/forum/t-200312/collisions-at-origin-why</link>
				<description>Using the Basic World Demo, boxes collide at origin instead of the outside.</description>
				<pubDate>Sat, 28 Nov 2009 02:32:09 +0000</pubDate>
				<wikidot:authorName>Joeinator</wikidot:authorName>				<wikidot:authorUserId>408649</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I've just completed the Basic World tutorial, and when I debug it, the two boxes don't collide with the outside of each other. Instead, the outsides of each box only collide with the origin of the other.<br /> Why is this happening? And how do I fix it?<br /> -Thanks</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-199716</guid>
				<title>Picking up objects and moving them.</title>
				<link>http://jiglibx.wikidot.com/forum/t-199716/picking-up-objects-and-moving-them</link>
				<description></description>
				<pubDate>Wed, 25 Nov 2009 02:51:10 +0000</pubDate>
				<wikidot:authorName>Ricsh</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi. trying to implement a way to pick up and move objects around. sort of like a gravity gun, but when trying to implement the jigglegame example into my game, i get some wired behaviour.</p> <p>For 1, picking does not work 100%<br /> and when it does i am unable to pick up objects. if i try pick up a box and there ar e a few boxes around it, they all disappear and the game gets very slugish, hinting they are around doing sumthing strange. and sometimes i get a Nan error. really unsure why as ive pretty much copied the jigglegame example. only thing i have different is a terrain.</p> <p>heres the update code from my main page:</p> <div class="code"> <pre> <code> // for picking float camPickDistance = 0.0f; bool middleButton = false; int oldWheel = 0; public override void Update() { //physics.UpdatePhysics = true; mouseState = Mouse.GetState(); //mouseState = Mouse.GetState(); position.X = mouseState.X; position.Y = mouseState.Y; Viewport vp = Engine.GraphicsDevice.Viewport; if ((vp.X &lt;= position.X) &amp;&amp; (position.X &lt;= (vp.X + vp.Width)) &amp;&amp; (vp.Y &lt;= position.Y) &amp;&amp; (position.Y &lt;= (vp.Y + vp.Height))) { //position += mouse.Delta * 5* // (float)Engine.GameTime.ElapsedGameTime.TotalSeconds; position.X = MathHelper.Clamp(position.X, vp.X, vp.X + vp.Width); position.Y = MathHelper.Clamp(position.Y, vp.Y, vp.Y + vp.Height); } else if (mouse.Delta.LengthSquared() &gt; 0f) { position.X = vp.X + vp.Width / 2; position.Y = vp.Y + vp.Height / 2; } mouse.Position= new Vector2((int)position.X, (int)position.Y); //mouse.Update(); _pointer.Update(); Vector3 inputModifier = new Vector3( (keyboard.IsKeyDown(Keys.A) ? -1 : 0) + (keyboard.IsKeyDown(Keys.D) ? 1 : 0), (keyboard.IsKeyDown(Keys.Q) ? -1 : 0) + (keyboard.IsKeyDown(Keys.E) ? 1 : 0), (keyboard.IsKeyDown(Keys.W) ? -1 : 0) + (keyboard.IsKeyDown(Keys.S) ? 1 : 0) ); if (keyboard.IsKeyDown(Keys.M) &amp;&amp; keyboard.IsKeyUp(Keys.M)) { } #region Picking Objects with the mouse if (mouse.IsButtonDown(MouseButtons.Middle)) { if (middleButton == false) { Vector3 ray = RayTo((int)mouse.Position.X, (int)mouse.Position.Y); float frac; CollisionSkin skin; Vector3 pos, normal; ImmovableSkinPredicate pred = new ImmovableSkinPredicate(); physicSystem.CollisionSystem.SegmentIntersect(out frac, out skin, out pos, out normal, new Segment(cam.Position, ray * 1000.0f), pred); if (skin != null) { if (!skin.Owner.Immovable) { Vector3 delta = pos - skin.Owner.Position; delta = Vector3.Transform(delta, Matrix.Transpose(skin.Owner.Orientation)); camPickDistance = (cam.Position - pos).Length(); oldWheel = mouse.State.ScrollWheelValue; skin.Owner.SetActive(); objectController.Destroy(); damperController.Destroy(); objectController.Initialise(skin.Owner, delta, pos); damperController.Initialise(skin.Owner, ConstraintVelocity.ReferenceFrame.Body, Vector3.Zero, Vector3.Zero); objectController.EnableConstraint(); damperController.EnableConstraint(); } } middleButton = true; } if (objectController.IsConstraintEnabled &amp;&amp; (objectController.Body != null)) { Vector3 delta = objectController.Body.Position - cam.Position; Vector3 ray = RayTo((int)mouse.Position.X,(int)mouse.Position.Y); ray.Normalize(); float deltaWheel = mouse.State.ScrollWheelValue - oldWheel; camPickDistance += deltaWheel * 0.01f; Vector3 result = cam.Position + camPickDistance * ray; oldWheel = mouse.State.ScrollWheelValue; objectController.WorldPosition = result; objectController.Body.SetActive(); } } else { objectController.DisableConstraint(); damperController.DisableConstraint(); middleButton = false; } #endregion</code> </pre></div> <p>and the method for the ray</p> <div class="code"> <pre> <code> private Vector3 RayTo(int x, int y) { FPSCamera cam = (FPSCamera)Engine.Services.GetService&lt;Camera&gt;(); Vector3 nearSource = new Vector3(x, y, 0); Vector3 farSource = new Vector3(x, y, 1); Matrix world = Matrix.CreateTranslation(0, 0, 0); Vector3 nearPoint = Engine.GraphicsDevice.Viewport.Unproject(nearSource, cam.Projection, cam.View, world); Vector3 farPoint = Engine.GraphicsDevice.Viewport.Unproject(farSource, cam.Projection, cam.View, world); Vector3 direction = farPoint - nearPoint; // direction.Normalize(); return direction; } and my physics system is currently set up like: physicSystem = new PhysicsSystem(); physicSystem.CollisionSystem = new CollisionSystemGrid(32, 32, 32, 30, 30, 30); // physicSystem.CollisionSystem = new CollisionSystemSAP(); physicSystem.EnableFreezing = true; physicSystem.SolverType = PhysicsSystem.Solver.Normal; physicSystem.CollisionSystem.UseSweepTests = true; physicSystem.NumCollisionIterations = 8; physicSystem.NumContactIterations = 8; physicSystem.NumPenetrationRelaxtionTimesteps = 15; can anyone see any reason why this shouldnt work in the same way it does in the jigglegame, or is there a even better way of picking up objects. Thanks in advance.</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-199441</guid>
				<title>TriangleMeshObject Error</title>
				<link>http://jiglibx.wikidot.com/forum/t-199441/trianglemeshobject-error</link>
				<description>Source array type cannot be assigned to destination array type</description>
				<pubDate>Tue, 24 Nov 2009 02:22:42 +0000</pubDate>
				<wikidot:authorName>Ricsh</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>cant get my triangle mesh objec to create a trianglemesh. here is my trainglemeshobject code</p> <div class="code"> <pre> <code>using System; using System.Collections.Generic; using JigLibX.Collision; using JigLibX.Geometry; using JigLibX.Math; using JigLibX.Physics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace qkGames { // A physics object that simulates all the individual polygons in a model public class TriangleMeshObject : PhysicsObject { // The generated mesh TriangleMesh triangleMesh; //string modelName; public List&lt;Vector3&gt; vertexList; // Constructors public List&lt;TriangleVertexIndices&gt; indexList; public TriangleMeshObject() : base() { Setup(null, Vector3.Zero, Vector3.Zero); } public TriangleMeshObject(string ModelName, Vector3 Position, Vector3 Rotation) : base() { Setup(ModelName, Position, Rotation); } public TriangleMeshObject(string ModelName, Vector3 Position, Vector3 Rotation, GameScreen Parent) : base(Parent) { Setup(ModelName, Position, Rotation); } // Sets up the object void Setup(string ModelName, Vector3 Position, Vector3 Rotation) { Model Model = Engine.Content.Load&lt;Model&gt;(ModelName); Body = new Body(); CollisionSkin = new CollisionSkin(null); //Body.CollisionSkin = CollisionSkin; //this.modelName = ModelName; //CollisionSkin.RemoveAllPrimitives(); triangleMesh = new TriangleMesh(); vertexList = new List&lt;Vector3&gt;(); indexList = new List&lt;TriangleVertexIndices&gt;(); ExtractData(vertexList, indexList, Model); //triangleMesh.CreateMesh( triangleMesh.CreateMesh(vertexList, indexList, 4, 1.0f); CollisionSkin.AddPrimitive(triangleMesh, new MaterialProperties(0.8f, 0.7f, 0.6f)); PhysicsSystem.CurrentPhysicsSystem.CollisionSystem.AddCollisionSkin(CollisionSkin); //Mass = Mass; this.Position = Position; CollisionSkin.ApplyLocalTransform(new Transform(-Position, Matrix.Identity)); // CollisionSkin. //this.EulerRotation = Rotation; } // Sets the model being simulated, extracts vertices, etc. public void SetModel(string ModelName) { } // Extracts the neccesary information from a model to // simulate physics on it public void ExtractData(List&lt;Vector3&gt; vertices, List&lt;TriangleVertexIndices&gt; indices,Model model) { Matrix[] bones_ = new Matrix[model.Bones.Count]; model.CopyAbsoluteBoneTransformsTo(bones_); foreach (ModelMesh mm in model.Meshes) { Matrix xform = bones_[mm.ParentBone.Index]; foreach (ModelMeshPart mmp in mm.MeshParts) { int offset = vertices.Count; Vector3[] a = new Vector3[mmp.NumVertices]; mm.VertexBuffer.GetData&lt;Vector3&gt;(mmp.StreamOffset + mmp.BaseVertex * mmp.VertexStride, a, 0, mmp.NumVertices, mmp.VertexStride); for (int i = 0; i != a.Length; ++i) Vector3.Transform(ref a[i], ref xform, out a[i]); vertices.AddRange(a); if (mm.IndexBuffer.IndexElementSize != IndexElementSize.SixteenBits) throw new Exception( String.Format("Model uses 32-bit indices, which are not supported.")); short[] s = new short[mmp.PrimitiveCount * 3]; mm.IndexBuffer.GetData&lt;short&gt;(mmp.StartIndex * 2, s, 0, mmp.PrimitiveCount * 3); JigLibX.Geometry.TriangleVertexIndices[] tvi = new JigLibX.Geometry.TriangleVertexIndices[mmp.PrimitiveCount]; for (int i = 0; i != tvi.Length; ++i) { tvi[i].I0 = s[i * 3 + 2] + offset; tvi[i].I1 = s[i * 3 + 1] + offset; tvi[i].I2 = s[i * 3 + 0] + offset; } indices.AddRange(tvi); } } } } }</code> </pre></div> <p>triangleMesh.CreateMesh(vertexList, indexList, 4, 1.0f);</p> <p>is throwing a<br /> System.ArrayTypeMismatchException was unhandled<br /> Message="Source array type cannot be assigned to destination array type."<br /> Source="mscorlib"<br /> StackTrace:<br /> at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)<br /> at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)<br /> at System.Collections.Generic.List`1.CopyTo(T[] array)<br /> at JigLibX.Geometry.Octree.AddTriangles(List`1 _positions, List`1 _tris)<br /> at JigLibX.Geometry.TriangleMesh.CreateMesh(List`1 vertices, List`1 triangleVertexIndices, Int32 maxTrianglesPerCell, Single minCellSize)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-199367</guid>
				<title>Problems with the car wheels and TriangleMeshObject</title>
				<link>http://jiglibx.wikidot.com/forum/t-199367/problems-with-the-car-wheels-and-trianglemeshobject</link>
				<description></description>
				<pubDate>Mon, 23 Nov 2009 19:49:50 +0000</pubDate>
				<wikidot:authorName>e66n06</wikidot:authorName>				<wikidot:authorUserId>406783</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hello,</p> <p>I've just started playing around with this library and one of the first things I tried was to remove the heightmap and use a custom .x model as a Triangle Mesh Object instead, this seems to work fine for the cubes and spheres, however the car seems to have problems, the wheels sink though the mesh, and the the chassis stops the car falling through the world. Is there something obvious I could be doing wrong?</p> <p>Here's a few screen shots:</p> <img src="http://i68.photobucket.com/albums/i29/e66n06/car1.jpg" alt="car1.jpg" class="image" /><br /> <img src="http://i68.photobucket.com/albums/i29/e66n06/car2.jpg" alt="car2.jpg" class="image" /><br /> <img src="http://i68.photobucket.com/albums/i29/e66n06/car3.jpg" alt="car3.jpg" class="image" /> <p>Is this a known bug?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-199172</guid>
				<title>Catching Collision events</title>
				<link>http://jiglibx.wikidot.com/forum/t-199172/catching-collision-events</link>
				<description></description>
				<pubDate>Mon, 23 Nov 2009 00:00:42 +0000</pubDate>
				<wikidot:authorName>Helpplz</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi.</p> <p>Is there anyone who can give an actuall example of catching collision events pls. ive looked at both the tutorial and fourm, but it seems they both assume i know more than i do.i half understand the code but Im unsure where to be putting each bit of code. and wat to be changing in each part :/</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-197093</guid>
				<title>Limit orientation constraint</title>
				<link>http://jiglibx.wikidot.com/forum/t-197093/limit-orientation-constraint</link>
				<description></description>
				<pubDate>Sun, 15 Nov 2009 17:31:55 +0000</pubDate>
				<wikidot:authorName>Camal</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I try to write a constraint which limits orientation of a body. (spherical joint)<br /> For example, i want to limit orientation from (-30, -30, 0) to (+30,+30, 0).</p> <p>I have tried to use two hinge joints (X axis and Y axis) but the<br /> result seems unstable.<br /> I have tried to compute axis angle from orientation matrix, in order<br /> to deduce torque to apply. The results seems unstable too.</p> <p>Any idea?</p> <p>Thank you</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-196861</guid>
				<title>NaN when trying to rotate my character</title>
				<link>http://jiglibx.wikidot.com/forum/t-196861/nan-when-trying-to-rotate-my-character</link>
				<description></description>
				<pubDate>Sat, 14 Nov 2009 18:18:30 +0000</pubDate>
				<wikidot:authorName>vandop</wikidot:authorName>				<wikidot:authorUserId>400128</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi!!!</p> <p>I'm trying to rotate my Character, using SetOrientation. But when I do that, my character disappears and in debug I can see that his position is NaN:|</p> <p>Some suggestion?</p> <p>Thanks</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-196817</guid>
				<title>Charchter controller flying off</title>
				<link>http://jiglibx.wikidot.com/forum/t-196817/charchter-controller-flying-off</link>
				<description>My charachter controller will fly off into the sky when i move on uneven terrain.</description>
				<pubDate>Sat, 14 Nov 2009 17:00:15 +0000</pubDate>
				<wikidot:authorName>Ricsh</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi, my charcter controller wont seem to work no matter what i do, it will fly off in to the sky doing circles when i go on uneven terrain. it seems a bit more stable on flat terrain.</p> <p>heres some of my code</p> <p>Charatcher controller.</p> <div class="code"> <pre> <code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using qkGames; using JigLibX.Physics; using Microsoft.Xna.Framework; using JigLibX.Collision; using Microsoft.Xna.Framework.Graphics; using JigLibX.Geometry; using JigLibX.Math; using Microsoft.Xna.Framework.Input; namespace qkGames { class CharacterObject : PhysicsObject { public Character CharacterBody {get; set;} public CharacterObject(Vector3 position) : base() { Body = new Character(); CollisionSkin = new CollisionSkin(Body); //public Vector3 DesiredVelocity { get; set; } Capsule capsule = new Capsule(Vector3.Zero, Matrix.CreateRotationX(MathHelper.PiOver2), 1.0f, 1.0f); CollisionSkin.AddPrimitive(capsule, (int)MaterialTable.MaterialID.NotBouncyNormal, new MaterialProperties(0.0f, 0.0f, 0.0f)); Body.CollisionSkin = this.CollisionSkin; Vector3 com = SetMass(1.0f); Body.MoveTo(position + com, Matrix.Identity); CollisionSkin.ApplyLocalTransform(new Transform(-com, Matrix.Identity)); //Body.BodyInertia(0.0f, 0.0f, 0.0f); //Body.SetBodyInvInertia(0.0f, 0.0f, 0.0f); CharacterBody = Body as Character; Body.AllowFreezing = false; Body.EnableBody(); } // public override void ApplyEffects(BasicEffect effect) //{ //throw new NotImplementedException(); //} } class ASkinPredicate : CollisionSkinPredicate1 { public override bool ConsiderSkin(CollisionSkin skin0) { if (!(skin0.Owner is Character)) return true; else return false; } } class Character : Body { public Character() : base() { } public Vector3 DesiredVelocity { get; set; } private bool doJump = false; public void DoJump() { doJump = true; } public override void AddExternalForces(float dt) { ClearForces(); if (doJump) { foreach (CollisionInfo info in CollisionSkin.Collisions) { Vector3 N = info.DirToBody0; if (this == info.SkinInfo.Skin1.Owner) Vector3.Negate(ref N, out N); if (Vector3.Dot(N, Orientation.Up) &gt; 0.7f) { Vector3 vel = Velocity; vel.Y = 5.0f; Velocity = vel; break; } } } Vector3 deltaVel = DesiredVelocity - Velocity; bool running = true; if (DesiredVelocity.LengthSquared() &lt; JiggleMath.Epsilon) running = false; else deltaVel.Normalize(); deltaVel.Y = 0.0f; // start fast, slow down slower if (running) deltaVel *= 10.0f; else deltaVel *= 2.0f; float forceFactor = 1000.0f; AddBodyForce(deltaVel * Mass * dt * forceFactor); doJump = false; AddGravityToExternalForce(); } } }</code> </pre></div> <p>And heres my terrain class</p> <div class="code"> <pre> <code>using System; using JigLibX.Geometry; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace qkGames { public class Terrain : Component, I3DComponent { // Height representation public float[,] heightData; // Physics height representation HeightMapInfo heightMapInfo; // Physics object HeightMapObject heightMapObject; // Terrain texture // Texture2D texture; public TerrainMaterial Material; // Vertex and index buffers VertexDeclaration myVertexDeclaration; VertexBuffer terrainVertexBuffer; IndexBuffer terrainIndexBuffer; // Effect BasicEffect basicEffect; // I3DComponent values Vector3 position = Vector3.Zero; Matrix rotation = Matrix.Identity; Vector3 scale = new Vector3(1, 1, -1); BoundingBox boundingBox = new BoundingBox(new Vector3(-1), new Vector3(1)); public Vector3 Position { get { return position; } set { position = value; } } public Vector3 EulerRotation { get { return MathUtil.MatrixToVector3(Rotation); } set { this.Rotation = MathUtil.Vector3ToMatrix(value); } } public Matrix Rotation { get { return rotation; } set { rotation = value; } } public Vector3 Scale { get { return scale; } set { scale = value; } } public BoundingBox BoundingBox { get { return boundingBox; } } // Constructors public Terrain(Texture2D HeightMap, Texture2D Texture) : base() { Setup(HeightMap, Texture); } public Terrain(Texture2D HeightMap, Texture2D Texture, GameScreen Parent) : base(Parent) { Setup(HeightMap, Texture); } void Setup(Texture2D Heightmap, Texture2D Texture) { // Load height data heightData = CreateTerrain(Heightmap); // Create vertex and index buffers myVertexDeclaration = new VertexDeclaration(Engine.GraphicsDevice, VertexPositionNormalTexture.VertexElements); VertexPositionNormalTexture[] terrainVertices = CreateVertices(); int[] terrainIndices = CreateIndices(); terrainVertices = GenerateNormalsForTriangleStrip(terrainVertices, terrainIndices); CreateBuffers(terrainVertices, terrainIndices); // Setup effect Material = new TerrainMaterial(Texture); } // Sets up terrain, texture, etc private float[,] CreateTerrain(Texture2D heightMap) { // Minimum and maximum heights for terrain float minimumHeight = 0; float maximumHeight = 255; // Width and height of terrain (from heightmap) int width = heightMap.Width; int height = heightMap.Height; // Setup bounding box with width and height boundingBox = new BoundingBox( new Vector3(-width / 2, maximumHeight - minimumHeight, -height / 2), new Vector3(width / 2, maximumHeight - minimumHeight, height / 2)); // Get data from heightmap Color[] heightMapColors = new Color[width * height]; heightMap.GetData&lt;Color&gt;(heightMapColors); // Setup height data from heightmap data float[,] heightData = new float[width, height]; for (int x = 0; x &lt; width; x++) for (int y = 0; y &lt; height; y++) { heightData[x, y] = heightMapColors[x + y * width].R; if (heightData[x, y] &lt; minimumHeight) minimumHeight = heightData[x, y]; if (heightData[x, y] &gt; maximumHeight) maximumHeight = heightData[x, y]; } for (int x = 0; x &lt; width; x++) for (int y = 0; y &lt; height; y++) heightData[x, y] = (heightData[x, y] - minimumHeight) / (maximumHeight - minimumHeight) * 30.0f; // Setup physics heightMapInfo = new HeightMapInfo(heightData, 1); if (heightMapObject != null) { heightMapObject.DisableComponent(); heightMapObject = null; } heightMapObject = new HeightMapObject(heightMapInfo, new Vector2( heightMapInfo.Width / 2, -heightMapInfo.Height / 2 + heightMapInfo.Height)); return heightData; } // Set up vertices private VertexPositionNormalTexture[] CreateVertices() { // Get width and height and create new vertex array int width = heightData.GetLength(0); int height = heightData.GetLength(1); VertexPositionNormalTexture[] terrainVertices = new VertexPositionNormalTexture[width * height]; // Calculate position, normal, and texcoords for vertices int i = 0; for (int z = 0; z &lt; height; z++) for (int x = 0; x &lt; width; x++) { Vector3 position = new Vector3(x, heightData[x, z], -z); Vector3 normal = new Vector3(0, 0, 1); Vector2 texCoord = new Vector2((float)x / 30.0f, (float)z / 30.0f); terrainVertices[i++] = new VertexPositionNormalTexture( position, normal, texCoord); } return terrainVertices; } // Set up indices private int[] CreateIndices() { // Get width and height and create new index array int width = heightData.GetLength(0); int height = heightData.GetLength(1); int[] terrainIndices = new int[(width) * 2 * (height - 1)]; // Calculate indices for triangle int i = 0; int z = 0; while (z &lt; height - 1) { for (int x = 0; x &lt; width; x++) { terrainIndices[i++] = x + z * width; terrainIndices[i++] = x + (z + 1) * width; } z++; if (z &lt; height - 1) { for (int x = width - 1; x &gt;= 0; x--) { terrainIndices[i++] = x + (z + 1) * width; terrainIndices[i++] = x + z * width; } } z++; } return terrainIndices; } // Generates normals for a group of triangles private VertexPositionNormalTexture[] GenerateNormalsForTriangleStrip( VertexPositionNormalTexture[] vertices, int[] indices) { for (int i = 0; i &lt; vertices.Length; i++) vertices[i].Normal = new Vector3(0, 0, 0); bool swappedWinding = false; for (int i = 2; i &lt; indices.Length; i++) { Vector3 firstVec = vertices[indices[i - 1]].Position - vertices[indices[i]].Position; Vector3 secondVec = vertices[indices[i - 2]].Position - vertices[indices[i]].Position; Vector3 normal = Vector3.Cross(firstVec, secondVec); normal.Normalize(); if (swappedWinding) normal *= -1; if (!float.IsNaN(normal.X)) { vertices[indices[i]].Normal += normal; vertices[indices[i - 1]].Normal += normal; vertices[indices[i - 2]].Normal += normal; } swappedWinding = !swappedWinding; } for (int i = 0; i &lt; vertices.Length; i++) vertices[i].Normal.Normalize(); return vertices; } // Sets up vertex and index buffers used for drawing private void CreateBuffers(VertexPositionNormalTexture[] vertices, int[] indices) { terrainVertexBuffer = new VertexBuffer(Engine.GraphicsDevice, VertexPositionNormalTexture.SizeInBytes * vertices.Length, BufferUsage.WriteOnly); terrainVertexBuffer.SetData(vertices); terrainIndexBuffer = new IndexBuffer(Engine.GraphicsDevice, typeof(int), indices.Length, BufferUsage.WriteOnly); terrainIndexBuffer.SetData(indices); } // Draw the terrain public override void Draw() { // Require the camera Camera camera = Engine.Services.GetService&lt;Camera&gt;(); if (camera == null) throw new Exception("The engine services does not contain a " + "camera service. The terrain requires a camera to draw."); // Set effect values Material.Prepare3DDraw(MathUtil.CreateWorldMatrix(position, rotation, scale)); // Get width and height int width = heightData.GetLength(0); int height = heightData.GetLength(1); // Terrain uses different vertex winding than normal models, //so set the new one Engine.GraphicsDevice.RenderState.CullMode = CullMode.CullClockwiseFace; // Start the effect Material.Effect.Begin(); // For each pass.. foreach (EffectPass pass in Material.Effect.CurrentTechnique.Passes) { // Begin the pass pass.Begin(); // Draw the terrain vertices and indices Engine.GraphicsDevice.Vertices[0].SetSource(terrainVertexBuffer, 0, VertexPositionNormalTexture.SizeInBytes); Engine.GraphicsDevice.Indices = terrainIndexBuffer; Engine.GraphicsDevice.VertexDeclaration = myVertexDeclaration; Engine.GraphicsDevice.DrawIndexedPrimitives( Microsoft.Xna.Framework.Graphics.PrimitiveType.TriangleStrip, 0, 0, width * height, 0, width * 2 * (height - 1) - 2); // End the pass pass.End(); } // End the effect Material.Effect.End(); // Set the vertex winding back Engine.GraphicsDevice.RenderState.CullMode = CullMode.CullCounterClockwiseFace; } } }</code> </pre></div> <p>And the update method of my main game</p> <div class="code"> <pre> <code>public override void Update() { //physics.UpdatePhysics = true; KeyboardDevice keyboard = Engine.Services.GetService&lt;KeyboardDevice&gt;(); MouseDevice mouse = Engine.Services.GetService&lt;MouseDevice&gt;(); Camera cam = (Camera)Engine.Services.GetService&lt;Camera&gt;(); Physics physics = Engine.Services.GetService&lt;Physics&gt;(); // Vector3 inputModifier = new Vector3( // (keyboard.IsKeyDown(Keys.A) ? -1 : 0) + (keyboard.IsKeyDown(Keys.D) ? 1 : 0), // (keyboard.IsKeyDown(Keys.Q) ? -1 : 0) + (keyboard.IsKeyDown(Keys.E) ? 1 : 0), // (keyboard.IsKeyDown(Keys.W) ? -1 : 0) + (keyboard.IsKeyDown(Keys.S) ? 1 : 0) // ); //cam.IsMousePinned = true; //cam.EnableKeyboardInput = false; cam.Position = character.Body.Position + Vector3.Up; //this.IsMouseVisible = false; Vector3 moveVector = new Vector3(); float amountOfMovement = 0.5f; if (keyboard.IsKeyDown(Keys.D)) moveVector += Vector3.Right; //character.Body.MoveTo(moveVector, cameraRotation); if (keyboard.IsKeyDown(Keys.A)) moveVector += Vector3.Left; if (keyboard.IsKeyDown(Keys.S)) moveVector += Vector3.Backward; if (keyboard.IsKeyDown(Keys.W)) moveVector += Vector3.Forward; Matrix cameraRotation = Matrix.CreateRotationX(cam.Angles.X) * Matrix.CreateRotationY(cam.Angles.Y); moveVector = Vector3.Transform(moveVector, cameraRotation); JiggleMath.NormalizeSafe(ref moveVector); moveVector *= amountOfMovement; //character.Body.MoveTo(moveVector, Matrix.Identity); character.CharacterBody.DesiredVelocity = moveVector; if (keyboard.IsKeyDown(Keys.Space)) character.CharacterBody.DoJump(); cam.RotateTranslate(new Vector3(mouse.Delta.Y * -.002f, mouse.Delta.X * -.002f, 0), Vector3.Zero * .05f);</code> </pre></div> <p>and my camera class incase it will help</p> <div class="code"> <pre> <code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; namespace qkGames { public class Camera : Component, I3DComponent { //basic camera class Vector3 rotation; Vector3 translation; //internal values Vector3 position = Vector3.Zero; Matrix rotationMatrix = Matrix.Identity; Vector3 target = new Vector3(0, 0, -1); Vector3 up = Vector3.Up; Matrix view; Matrix projection; private Vector2 angles = Vector2.Zero; //camera look at public Vector2 Angles { get { return angles; } } public virtual Vector3 Target { get { return target; } set { Vector3 forward = Vector3.Normalize(position - value); Vector3 right = Vector3.Normalize(Vector3.Cross(forward, Vector3.Up)); Vector3 up = Vector3.Normalize(Vector3.Cross(right, forward)); Matrix test = Matrix.Identity; test.Forward = forward; test.Right = right; test.Up = up; angles.X = -(float)Math.Asin(test.M32); angles.Y = -(float)Math.Asin(test.M13); target = value; } } // the view and proj matrixes commonly used for renderin public virtual Matrix View { get { return view; } set { view = value; } } public virtual Matrix Projection { get { return projection; } set { projection = value; } } public virtual Vector3 Up { get { return up; } set { up = value; } } public virtual Vector3 Position { get { return position; } set { position = value; } } public virtual Vector3 Scale { get { return Vector3.One; } set { } } public Vector3 EulerRotation { get { return MathUtil.MatrixToVector3(rotationMatrix); } set { rotationMatrix = MathUtil.Vector3ToMatrix(value); } } //the rotation matrix used by camera an up public virtual Matrix Rotation { get { return rotationMatrix; } set { rotationMatrix = value; } } public virtual BoundingBox BoundingBox { get { return new BoundingBox(position - Vector3.One, position + Vector3.One); } } //Constructors public Camera(GameScreen Parent) : base(Parent) { } public Camera() : base() { } //update camera public void RotateTranslate(Vector3 Rotation, Vector3 Trans) { translation += Trans; rotation += Rotation; } public override void Update() { //calc the direction from the postition to the target and normalise Vector3 newForward = Target - position; newForward.Normalize(); //set the rotation matrix and forward to this vector Matrix rotationMatrixCopy = this.Rotation; rotationMatrixCopy.Forward = newForward; //save a copy of up Vector3 referenceVector = Vector3.Up; //incase camera is pointed perfectly on y axis if (rotationMatrixCopy.Forward.Y == referenceVector.Y || rotationMatrixCopy.Forward.Y == -referenceVector.Y) referenceVector = Vector3.Backward; //calc the parts of rotation matrix rotationMatrixCopy.Right = Vector3.Cross(this.Rotation.Forward, referenceVector); rotationMatrixCopy.Up = Vector3.Cross(this.Rotation.Right, this.Rotation.Forward); this.Rotation = rotationMatrixCopy; //use rotation to find new up up = rotationMatrixCopy.Up; //recalc view and proj View = Matrix.CreateLookAt(position, Target, Up); Projection = MathUtil.CreateProjectionMatrix(); } } }</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-196596</guid>
				<title>RC-AirSim: r/c model airplane flight simulator</title>
				<link>http://jiglibx.wikidot.com/forum/t-196596/rc-airsim:r-c-model-airplane-flight-simulator</link>
				<description>RC-AirSim, the r/c model airplane flight simulator on Xbox 360 Indie Games uses JigLibX for the plane crash effect.</description>
				<pubDate>Fri, 13 Nov 2009 19:04:02 +0000</pubDate>
				<wikidot:authorName>SomeCallMeTim</wikidot:authorName>				<wikidot:authorUserId>274272</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>RC-AirSim, the r/c model airplane flight simulator on Xbox 360 Indie Games uses JigLibX for the plane crash effect.</p> <p>I recently updated RC-AirSim to include this JigLibX powered plane crash effect. You can download the free demo version to your Xbox 360 from the xbox.com marketplace:</p> <p><a href="http://marketplace.xbox.com/en-US/games/media/66acd000-77fe-1000-9115-d80258550171/">RC-AirSim on the xbox.com marketplace</a></p> <p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/g0AoTkk7sT8&amp;hl=en_US&amp;fs=1&amp;" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /> <embed src="http://www.youtube.com/v/g0AoTkk7sT8&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344" /></object></p> <p>Thank you to the JigLibX community!!</p> <p>-Tim</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-196134</guid>
				<title>how to move objects?</title>
				<link>http://jiglibx.wikidot.com/forum/t-196134/how-to-move-objects</link>
				<description></description>
				<pubDate>Thu, 12 Nov 2009 09:35:51 +0000</pubDate>
				<wikidot:authorName>ali</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I really can't figure it out, I used Body.Velocity it does work, but it seems buggy. Also I tried to create Controller and use Body.AddBodyForce(), again fail. Does anyone know how to move Body? if you have working code of this, post it, please.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-196078</guid>
				<title>intersection detection</title>
				<link>http://jiglibx.wikidot.com/forum/t-196078/intersection-detection</link>
				<description></description>
				<pubDate>Thu, 12 Nov 2009 05:16:07 +0000</pubDate>
				<wikidot:authorName>nikita</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>hello everyone,<br /> I'm trying to code one feature for my 3rd person game, i have the camera class and class for character, the problem is in camera class, it always moves after character(it's normal), but when the character is situated in front of some object, and camera is behind it's a problem. For solving this I want to move camera closer to character, when such situation appears, then camera will take it initial state, corresponding to character position.<br /> I tried to use the technique that had been used in jigglegame for picking object with a mouse. this is it:</p> <div class="code"> <pre> <code> float frac; CollisionSkin skin; Vector3 pos, normal; ImmovableSkinPredicate pred = new ImmovableSkinPredicate(); PhysicsSys.CollisionSystem.SegmentIntersect(out frac, out skin, out pos, out normal, new Segment(Camera.Position, Character.Position), pred); if ((skin != null )&amp;&amp; (skin.Owner != null)&amp;&amp;(skin.Owner != Character.collisionBody)) { // problem } else { // no problem }</code> </pre></div> <p>Logically it must detect if something is situated between camera and character, but this code doesn't work. Where am I mistaken?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195992</guid>
				<title>How to detect objects within a certain distance of an object</title>
				<link>http://jiglibx.wikidot.com/forum/t-195992/how-to-detect-objects-within-a-certain-distance-of-an-object</link>
				<description></description>
				<pubDate>Wed, 11 Nov 2009 23:49:52 +0000</pubDate>
				<wikidot:authorName>Tom</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>How would you go about finding all objects within a certain distance so you can then add forces to all objects within that certain distance, would you use a bounding sphere or something similar? how would you go about doing this, and how would you set it up?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195979</guid>
				<title>Pair of questions about Collision Handlers</title>
				<link>http://jiglibx.wikidot.com/forum/t-195979/pair-of-questions-about-collision-handlers</link>
				<description></description>
				<pubDate>Wed, 11 Nov 2009 22:55:07 +0000</pubDate>
				<wikidot:authorName>vandop</wikidot:authorName>				<wikidot:authorUserId>400128</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi Everyone!</p> <p>I got two problems, I'm handling collisions with other objects with this:</p> <div class="code"> <pre> <code>YourObject.Skin.callbackFn += new CollisionCallbackFn(handleCollisionDetection);</code> </pre></div> <p>1. So, when I put a body as Immovable, is not generated an event… is normal? I can change this behavior?</p> <p>2. Imagine that you want to kill the object when collide with it, so how can I destroy the object and stop receiving collision events from it? I'm trying body.DisableBody(), but I got an error in CollisionTest:\</p> <p>Please help me, if you can.</p> <p>Thanks and sorry about english.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195582</guid>
				<title>Help Integrating JigLibX into a game</title>
				<link>http://jiglibx.wikidot.com/forum/t-195582/help-integrating-jiglibx-into-a-game</link>
				<description></description>
				<pubDate>Tue, 10 Nov 2009 15:45:37 +0000</pubDate>
				<wikidot:authorName>Firefly09</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>I am trying to implement JigLibX into my project however I am struggling to get it to work. I want to add physics to my main character so to do this I added in the physics object class, box object class and some extra properties for position etc. however this didn't work. To make my character move I tried doing this:</p> <div class="code"> <pre> <code>Vector3 value = physicsObject.PhysicsBody.Position + Direction * movement * (float)e.Time.ElapsedGameTime.TotalMilliseconds * 3.0f; physicsObject.PhysicsBody.MoveTo(value, physicsObject.PhysicsBody.Orientation);</code> </pre></div> <p>my player moved around properly but this stopped gravity from being applied to my character for some reason.</p> <p>So I downloaded the Character example and added the character object class and tried doing</p> <div class="code"> <pre> <code>CharacterObject.CharacterBody.DesiredVelocity = Direction * movement * (float)e.Time.ElapsedGameTime.TotalMilliseconds * 3.0f;</code> </pre></div> <p>But this made my character move so slow it looks like he is not moving at all. However gravity now applies to my Character.</p> <p>Can anyone give me any suggestions on what im doing wrong, or if there are any other examples that I could look at?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195492</guid>
				<title>How to determine if physics body is inside of a TriangleMesh</title>
				<link>http://jiglibx.wikidot.com/forum/t-195492/how-to-determine-if-physics-body-is-inside-of-a-trianglemesh</link>
				<description></description>
				<pubDate>Tue, 10 Nov 2009 10:44:31 +0000</pubDate>
				<wikidot:authorName>Jacc</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>The problem I have is I have two physics objects. One is a large TriangleMeshObject and the other is a small sphere. The TriangleMeshObject is very large compared to the sphere and I want the sphere to be able to move inside of the TriangleMeshObject. This if fine and I have this working. The problem is, is that I want to detect whether the sphere is inside the volume of the TriangleMeshObject, in other words I want the TriangleMeshObject to act like a trigger volume. Is it possible using JigLibX to detect if a physics primitive is inside of a TriangleMeshObject?</p> <p>The reason I want this is that I can detect that there is a collision between the TriangleMeshObject's edges and the sphere, but I cannot detect collision once the sphere is inside of TriangleMeshObject - but this is what I would like.</p> <p>Thanks for any help</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195108</guid>
				<title>TriangleMesh not moving?</title>
				<link>http://jiglibx.wikidot.com/forum/t-195108/trianglemesh-not-moving</link>
				<description>Shouldnt body.MoveTo work for trianglemeshes now?</description>
				<pubDate>Mon, 09 Nov 2009 12:52:26 +0000</pubDate>
				<wikidot:authorName>Stig-Rune Skansgård</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>I'm involved with the development of Break a Leg for the XBox360, and we have a rather huge problem:<br /> how come body.MoveTo() doesnt move and rotate trianglemeshes? is there any fix for this?<br /> not being able to reuse trimeshes is making the performance lousy (GC-latency @ ~580ms and level-loading tedious, as we have to make a new trimesh for every instance of a building (we have 1k+ in the DEMO-level alone)).</p> <p>Any help would be NICE:D</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-195102</guid>
				<title>Bug in new GetPoint</title>
				<link>http://jiglibx.wikidot.com/forum/t-195102/bug-in-new-getpoint</link>
				<description>The new patched GetPoint is bugged.</description>
				<pubDate>Mon, 09 Nov 2009 12:21:32 +0000</pubDate>
				<wikidot:authorName>Marco Altomonte</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>GetPoint function in JigLibX\Geometry\Line.cs is:</p> <p>// BEN-OPTIMISATION: New method, ref point.<br /> public void GetPoint(ref Vector3 point, float t)<br /> {<br /> point.X = t * Delta.X + Origin.X;<br /> point.Y = t * Delta.X + Origin.X;<br /> point.Z = t * Delta.X + Origin.X;<br /> }</p> <p>but it should be:</p> <p>// BEN-OPTIMISATION: New method, ref point.<br /> public void GetPoint(ref Vector3 point, float t)<br /> {<br /> point.X = t * Delta.X + Origin.X;<br /> point.Y = t * Delta.Y + Origin.Y;<br /> point.Z = t * Delta.Z + Origin.Z;<br /> }</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-194925</guid>
				<title>question about gravity</title>
				<link>http://jiglibx.wikidot.com/forum/t-194925/question-about-gravity</link>
				<description>objects fall to slow</description>
				<pubDate>Sun, 08 Nov 2009 22:13:43 +0000</pubDate>
				<wikidot:authorName>nikita</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>hello<br /> I tried to use classes from the tutorials on this site, but objects are falling very slowly, I played with the mass property of collision body, but it doesn't seem to take any effect, is there any way to increase gravity or really increase the mass of an object.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-194830</guid>
				<title>Character - Restrict Climb Angle</title>
				<link>http://jiglibx.wikidot.com/forum/t-194830/character-restrict-climb-angle</link>
				<description></description>
				<pubDate>Sun, 08 Nov 2009 12:46:32 +0000</pubDate>
				<wikidot:authorName>vandop</wikidot:authorName>				<wikidot:authorUserId>400128</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi everyone!</p> <p>I'm starting a new game and I'm trying to create a controller based on experimental jiglib's controller. But how can I restrict some movement like maximum step angle? So what I want is that my controller don't climb hills like walk in plane ground. How can I modulate that behavior?</p> <p>Sorry about english.</p> <p>Thanks</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-194561</guid>
				<title>Explosions</title>
				<link>http://jiglibx.wikidot.com/forum/t-194561/explosions</link>
				<description></description>
				<pubDate>Sat, 07 Nov 2009 08:53:56 +0000</pubDate>
				<wikidot:authorName>Furball</wikidot:authorName>				<wikidot:authorUserId>399655</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>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?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-194174</guid>
				<title>Character -  Change moviment style</title>
				<link>http://jiglibx.wikidot.com/forum/t-194174/character-change-moviment-style</link>
				<description>i want to rotate the character whe i press left or right - something like rts games</description>
				<pubDate>Thu, 05 Nov 2009 13:25:15 +0000</pubDate>
				<wikidot:authorName>Thiago</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>i tried everything, aplying Torque, changing angular speed … but no success<br /> anyone knows how to done this.<br /> i just want the character to rotate a little when i click left or right.<br /> some light pls</p> <p>thank you in advance.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-193949</guid>
				<title>Moveable box - Objects falling through</title>
				<link>http://jiglibx.wikidot.com/forum/t-193949/moveable-box-objects-falling-through</link>
				<description></description>
				<pubDate>Wed, 04 Nov 2009 13:54:03 +0000</pubDate>
				<wikidot:authorName>Mojo</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>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.</p> <p>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.</p> <p>Any ideas?</p> <p>Thanks</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-193190</guid>
				<title>Character controller issue</title>
				<link>http://jiglibx.wikidot.com/forum/t-193190/character-controller-issue</link>
				<description>Character&#039;s capsule falls over, responds to collision</description>
				<pubDate>Sun, 01 Nov 2009 17:37:40 +0000</pubDate>
				<wikidot:authorName>Nic</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I'm trying to implement the experimental character controller in my engine, but the capsule falls over just like any regular capsule shape would. Additionally, the character's capsule responds to collision, so it gets knocked around very easily. I can't seem to find the code in the sample code that prevents this undesired behavior. I basically want my capsule acting similar to the one in the sample code.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-192991</guid>
				<title>Jittering with custom DetectFunctor</title>
				<link>http://jiglibx.wikidot.com/forum/t-192991/jittering-with-custom-detectfunctor</link>
				<description>I have created a custom DetectFunctor.  When collisions use it, they never rest on top of each other.</description>
				<pubDate>Sat, 31 Oct 2009 16:04:37 +0000</pubDate>
				<wikidot:authorName>Andrew</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I created a custom DetectFunctor which handles collisions between the built-in JigLibX types (boxes, etc) and my custom terrain (built from model vertex data). It works as expected with the exception of when an object is in constant contact with the terrain. In that situation, the object will seem to vibrate on the surface (in the y-axis).</p> <p>I think my issue is with returning the penetration distance. Here is the code below that is in question:</p> <div class="code"> <pre> <code> public override void CollDetect(CollDetectInfo infoOrig, float collTolerance, CollisionFunctor collisionFunctor) { //SNIP! Vector3 newPt = newPts[i], oldPt = oldPts[i]; float newDist; Vector3 normal, collisionPosition; bool immediateCheck = customTerrainPrim.RayIntersect(out newDist, out collisionPosition, out normal, oldPt, newPt); if (immediateCheck) { if (newDist &lt; collTolerance) { float oldDist = collisionPosition.Y + collTolerance;</code> </pre></div> <p>The rest of the DetectFunctor is taken from the BoxHeightMap one (included in JibLibX). The RayIntersect method checks for a collision on a plane along the vector starting at oldPt and going to newPt. It returns true if there is a collision, and then the distance to the plane (from the starting point), the point of the collision, and the normal of the collided plane.</p> <p>Initially, I tried setting the penetration to the distance between the end point of the ray and the collision point; however, that resulted in objects falling through the custom terrain. Setting the penetration to the height of the terrain at the collision keeps objects above it, but they vibrate.</p> <p>Any ideas? Or maybe more information on what the penetration represents?</p> <p>Thanks!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-192846</guid>
				<title>Xbox Performance</title>
				<link>http://jiglibx.wikidot.com/forum/t-192846/xbox-performance</link>
				<description></description>
				<pubDate>Sat, 31 Oct 2009 02:10:36 +0000</pubDate>
				<wikidot:authorName>kolk3</wikidot:authorName>				<wikidot:authorUserId>396460</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi, i have downloaded the last source of JiglibX. Then when i build it for Xbox360 the performance was very bad. I dont know if the example was to windows(there was only a keyboard and mouse input)… And i found a bug when tried to compile. The bug was found at GetVelocity method or something like this. A " out Vector3 result" parameter is used and is set with result.X = someValue; but on Xbox this is not possible. the correct is "result = new Vector3()" and then set the result values.</p> <p>Sorry about my english, im brazilian!</p> <p>Thankz!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-192319</guid>
				<title>TriangleMeshObject - simple mesh animation?</title>
				<link>http://jiglibx.wikidot.com/forum/t-192319/trianglemeshobject-simple-mesh-animation</link>
				<description></description>
				<pubDate>Wed, 28 Oct 2009 20:00:38 +0000</pubDate>
				<wikidot:authorName>Rob</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I have read through the forums and documentation understand that you are not supposed to use the TriangleMeshObject for anything other than static collision meshes. This makes sense to me however I would like to understand the problem with this to hopefully be able to come up with a solution to allow me to animate a very low poly model for a medical sim.</p> <p>My assumption after reading through the code is that if the vertex positions change then you also need to update the octree so that collisions still happen correctly. The Octree building seems to be the slow part in my timing tests. And it also looks like the positions in the Octree are used for the collision detection; the GetVertex call seems to return the stored vertex. I was wondering if, for a very low poly model (like 128 triangles), you could only have one bounding box in the Octree. If the vertex grid was small would it be fast enough to just update the vertex positions without touching the Octree? Is there anything I have missed?</p> <p>Thanks for your help. So far JiglibX has been a savior!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-192316</guid>
				<title>Model as collision skin?</title>
				<link>http://jiglibx.wikidot.com/forum/t-192316/model-as-collision-skin</link>
				<description>I read it&#039;s possible but how?</description>
				<pubDate>Wed, 28 Oct 2009 19:44:55 +0000</pubDate>
				<wikidot:authorName>Hunter</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>So far I found one site (the XNA forum) that has a partial code on extracting vertice information on a model, but it doesnt work.<br /> I assume here its possible to use a model as collision skin on another model (for a static object atleast), but how does this work?</p> <div class="code"> <pre> <code>1 using System; 2 using System.Collections.Generic; 3 using Microsoft.Xna.Framework; 4 using Microsoft.Xna.Framework.Graphics; 5 using JigLibX.Math; 6 using JigLibX.Physics; 7 using JigLibX.Geometry; 8 using JigLibX.Collision; 9 10 namespace Tanks.Game.Tanks 11 { 12 class Tank : DrawableGameComponent 13 { 14 protected Vector3 position; 15 protected Vector3 scale; 16 17 protected Texture2D collisionTexture; 18 19 protected Model model; 20 21 protected Body body; 22 public Body Body 23 { 24 get { return body; } 25 } 26 27 protected CollisionSkin skin; 28 public CollisionSkin Skin 29 { 30 get { return skin; } 31 } 32 33 protected TriangleMesh triangleMesh; 34 35 public Tank(Microsoft.Xna.Framework.Game game, Vector3 position, Vector3 scale) 36 : base(game) 37 { 38 this.position = position; 39 this.scale = scale; 40 } 41 42 protected override void LoadContent() 43 { 44 model = Game.Content.Load&lt;Model&gt;("Models/wedge"); 45 46 collisionTexture = Game.Content.Load&lt;Texture2D&gt;("Textures/Models/collision"); 47 48 body = new Body(); 49 skin = new CollisionSkin(body); 50 51 body.CollisionSkin = skin; 52 53 triangleMesh = new TriangleMesh(); 54 55 List&lt;Vector3&gt; vertexList = new List&lt;Vector3&gt;(); 56 List&lt;TriangleVertexIndices&gt; indexList = new List&lt;TriangleVertexIndices&gt;(); 57 58 ExtractModelData(vertexList, indexList, model); 59 60 triangleMesh.CreateMesh(vertexList, indexList, 4, 1.0f); 61 62 skin.AddPrimitive(triangleMesh, 1, new MaterialProperties(0.8f, 0.7f, 0.6f)); 63 64 Vector3 com = setMass(10.0f); 65 66 body.MoveTo(position, Matrix.Identity); 67 68 skin.ApplyLocalTransform(new Transform(-com, Matrix.Identity)); 69 70 body.EnableBody(); 71 } 72 73 private Matrix getWorldMatrix() 74 { 75 return Matrix.CreateScale(scale) * skin.GetPrimitiveLocal(0).Transform.Orientation * body.Orientation * Matrix.CreateTranslation(body.Position); 76 } 77 78 public override void Draw(GameTime gameTime) 79 { 80 Game1 game = (Game1)Game; 81 82 Matrix[ transforms = new Matrix[model.Bones.Count]; 83 model.CopyAbsoluteBoneTransformsTo(transforms); 84 85 Matrix worldMatrix = getWorldMatrix(); 86 87 foreach (ModelMesh mesh in model.Meshes) 88 { 89 foreach (BasicEffect effect in mesh.Effects) 90 { 91 effect.Texture = collisionTexture; // Assign the texture 92 effect.TextureEnabled = true; // Enable drawing the texture 93 effect.EnableDefaultLighting(); 94 effect.PreferPerPixelLighting = true; 95 effect.World = transforms[mesh.ParentBone.Index] 96 * worldMatrix; 97 effect.View = game.View; 98 effect.Projection = game.Projection; 99 } 100 mesh.Draw(); 101 } 102 } 103 104 public override void Update(GameTime gameTime) 105 { 106 base.Update(gameTime); 107 } 108 109 protected Vector3 setMass(float mass) 110 { 111 PrimitiveProperties primitiveProperties = new PrimitiveProperties(PrimitiveProperties.MassDistributionEnum.Solid, 112 PrimitiveProperties.MassTypeEnum.Mass, 113 mass); 114 115 float junk; 116 Vector3 com; 117 Matrix it; 118 Matrix itCoM; 119 120 Skin.GetMassProperties(primitiveProperties, out junk, out com, out it, out itCoM); 121 122 Body.BodyInertia = itCoM; 123 Body.Mass = junk; 124 125 return com; 126 } 127 128 protected void ExtractModelData(List&lt;Vector3&gt; vertices, List&lt;TriangleVertexIndices&gt; indices, Model model) 129 { 130 Matrix[ bones_ = new Matrix[model.Bones.Count]; 131 model.CopyAbsoluteBoneTransformsTo(bones_); 132 foreach (ModelMesh mm in model.Meshes) 133 { 134 Matrix xform = bones_[mm.ParentBone.Index]; 135 foreach (ModelMeshPart mmp in mm.MeshParts) 136 { 137 int offset = vertices.Count; 138 Vector3[ a = new Vector3[mmp.NumVertices]; 139 mm.VertexBuffer.GetData&lt;Vector3&gt;(mmp.StreamOffset + mmp.BaseVertex * mmp.VertexStride, 140 a, 0, mmp.NumVertices, mmp.VertexStride); 141 for (int i = 0; i != a.Length; ++i) 142 Vector3.Transform(ref a[i], ref xform, out a[i]); 143 vertices.AddRange(a); 144 145 if (mm.IndexBuffer.IndexElementSize != IndexElementSize.SixteenBits) 146 throw new Exception( 147 String.Format("Model uses 32-bit indices, which are not supported.")); 148 short[ s = new short[mmp.PrimitiveCount * 3]; 149 mm.IndexBuffer.GetData&lt;short&gt;(mmp.StartIndex * 2, s, 0, mmp.PrimitiveCount * 3); 150 JigLibX.Geometry.TriangleVertexIndices[ tvi = new JigLibX.Geometry.TriangleVertexIndices[mmp.PrimitiveCount]; 151 for (int i = 0; i != tvi.Length; ++i) 152 { 153 tvi[i].I0 = s[i * 3 + 2] + offset; 154 tvi[i].I1 = s[i * 3 + 1] + offset; 155 tvi[i].I2 = s[i * 3 + 0] + offset; 156 } 157 indices.AddRange(tvi); 158 } 159 } 160 } 161 } 162 } 163</code> </pre></div> <p>This I picked up from <a href="http://forums.xna.com/forums/p/17266/90090.aspx">here</a></p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-192203</guid>
				<title>Spheres won&#039;t roll</title>
				<link>http://jiglibx.wikidot.com/forum/t-192203/spheres-won-t-roll</link>
				<description></description>
				<pubDate>Wed, 28 Oct 2009 10:24:43 +0000</pubDate>
				<wikidot:authorName>Vaaaan</wikidot:authorName>				<wikidot:authorUserId>392840</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'm having a problem getting spheres to roll, even though they bounce and slide just fine. I initially thought it was a problem in the draw method, but if I give a sphere an initial angular velocity it rotates and renders correctly. If I watch a sphere's collision skin orientation matrix while debugging (without giving it an initial angular velocity, but with external collisions affecting it enough where it should rotate), it doesn't show significant rotation, but it also doesn't stay at identity. It'll show something like 0.9998 in place of the 1's or 0.0003 in place of 0's. The orientation changes each frame but always stays within a few thousanths of identity. The angular velocity stays extremely small but non-zero. The sphere's also don't react at all to force or torque from a controller. The only way I can get them to move is by hitting them (or giving an initial velocity), but then they don't rotate.</p> <p>The relevant parts of my code are nearly identical to the sample. Any ideas what's wrong?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-191893</guid>
				<title>Retrieving bounding extents of animated model at a run time</title>
				<link>http://jiglibx.wikidot.com/forum/t-191893/retrieving-bounding-extents-of-animated-model-at-a-run-time</link>
				<description></description>
				<pubDate>Tue, 27 Oct 2009 03:51:01 +0000</pubDate>
				<wikidot:authorName>Cheburek</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hello guys,</p> <p>First of all great thanks for the awesome engine you made.</p> <p>I am planning to integrate JigLibX into my game engine and I have several questions. I have animated characters and I need to constantly know their size. I was planning to use CharacterObject from tutorials to represent a character (maybe thats not a best solution for constantly changing body size?).</p> <p>Maybe I should keep the body size constant… but the main problem is if I retrieve the bounding box at model processor stage it completely does not match the animated model. And I end up with misplaced/incorrectly scaled physics body.</p> <p>Another question is adding a ragdoll. I would like to have a knock-down effect for my characters (uh oh! :D ). Ive looked at the sample game, but I need this implemented with model's bones rather then primitives.</p> <p>I have some experience with animation, as well as bone transformations but I dont really have any idea how to get everything working together. If anyone has done anything similar or has any advice would be greatly appreciated!</p> <p>Thanks!</p> <p>P.S. I am using kW animation if it changes anything</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-191408</guid>
				<title>Skinned Mesh Ragdoll</title>
				<link>http://jiglibx.wikidot.com/forum/t-191408/skinned-mesh-ragdoll</link>
				<description>Just a first pass at mixing animation and physics</description>
				<pubDate>Sat, 24 Oct 2009 16:39:35 +0000</pubDate>
				<wikidot:authorName>PGlynn</wikidot:authorName>				<wikidot:authorUserId>387675</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p><object width="640" height="480"><param name="movie" value="http://www.youtube.com/v/nQ0uN-IRu3A&amp;hl=en&amp;fs=1&amp;" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /> <embed src="http://www.youtube.com/v/nQ0uN-IRu3A&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="480" /></object></p> <p>Sorry about the music, was listening to radio.</p> <p>JigLibX for physics and Kilowatt Animation</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-190956</guid>
				<title>Complex shapes using constraints</title>
				<link>http://jiglibx.wikidot.com/forum/t-190956/complex-shapes-using-constraints</link>
				<description></description>
				<pubDate>Thu, 22 Oct 2009 15:51:02 +0000</pubDate>
				<wikidot:authorName>Vaaaan</wikidot:authorName>				<wikidot:authorUserId>392840</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi, I'm wondering if the constraints lock things into place well enough to make complex shapes that maintain rigidity. For example, if I wanted to make a simple L-shaped hockey stick, could I use two boxes connected with constraints and end up with a completely solid hockey stick? Or would I be better off making an L-shaped model and using it as a triangle mesh?</p> <p>Or maybe both would work, but perform better/worse in different situations? Any input is appreciated.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-190617</guid>
				<title>Collision location is incorrect for collision detection?</title>
				<link>http://jiglibx.wikidot.com/forum/t-190617/collision-location-is-incorrect-for-collision-detection</link>
				<description></description>
				<pubDate>Wed, 21 Oct 2009 14:49:49 +0000</pubDate>
				<wikidot:authorName>Rhys Perkins</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <div class="code"> <pre> <code> physics_Engine.CollisionSystem.DetectAllCollisions(body_List, collision_Functor, null, 0.05f); collision_Number_Of = collision_Info.Count; // Check if there is new collision information if (collision_Number_Of &gt; 0) { foreach (CollisionInfo info in collision_Info) { // Find all the collision points for (int i = 0; i &lt; info.NumCollPts; i++) { // Can use R0 OR R1 collision_Location += info.PointInfo[i].Info.R1; } // Then average those points collision_Location /= info.NumCollPts; .....</code> </pre></div> <p>The collision_Location is returning an incorrect y coordinate in each case.</p> <p>For example if I have two bodies colliding (sphere and a plane) this is what is returned from the info:</p> <p>The collision normal is (0,1,0) as the plane normal is also (0,1,0).</p> <p>Body 0 Location: {X:-23.98825 Y:-9.453318 Z:-3.494735}<br /> Body 1 Location: {X:0 Y:-10 Z:0}<br /> Collision Location: {X:-23.98187 Y:0.05135918 Z:-3.492474}</p> <p>Compare that to the initial penetration:<br /> Initial Penetration: -0.05135918</p> <p>AND</p> <p>Body 0 Location: {X:-19.58015 Y:-9.45322 Z:28.66841}<br /> Body 1 Location: {X:0 Y:-10 Z:0}<br /> Collision Location: {X:-19.57597 Y:0.05132675 Z:28.66336}<br /> Initial Penetration: -0.05132675</p> <p>Can someone please explain what is going on here? Have I found a bug?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-190290</guid>
				<title>Show Off Throwing, Swinging From Vines, and some simple collisions</title>
				<link>http://jiglibx.wikidot.com/forum/t-190290/show-off-throwing-swinging-from-vines-and-some-simple-collisions</link>
				<description>I&#039;m a professional freelance programmer of 9 years. Recently quit my job to work full time on gave development and maybe make something of it. Here are a few videos of my implementation of JibLibX</description>
				<pubDate>Tue, 20 Oct 2009 06:48:25 +0000</pubDate>
				<wikidot:authorName>Mike Tsouris</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Here are some videos of my game progress. There are more videos, but these are the ones that show what i'm doing with JigLibX specifically…..</p> <p>My Favorite - Player that can attach itself to a swinging vine and then, 'let go' and have the swinging vine's velocity directly transferred to the character, sending it flying away…</p> <p><a href="http://www.youtube.com/watch?v=QMe1A3-kRfM">http://www.youtube.com/watch?v=QMe1A3-kRfM</a></p> <p>… also, if the vine is not swinging at all (Vine.Velocity.Length() &lt; MinimumThreshold), the players velocity is transferred to the vine and gets the vine swinging (0:56 into the video)</p> <p>Projectiles who's velocity and 'take off position' are mapped dynamically to the animation of bone location of the animated model's right hand (yes, if it was animated to throw faster, the object would actually go faster….. no hard coded values here!….. maybe i'm giving too much power to the animators, ha)<br /> <a href="http://www.youtube.com/watch?v=d0a4HZKxpmY">http://www.youtube.com/watch?v=d0a4HZKxpmY</a></p> <p>Scaled and Rotated OcTree and some falling boxes (not as cool now that you have seen the other stuff)<br /> <a href="http://www.youtube.com/watch?v=ee7tfmWD48o">http://www.youtube.com/watch?v=ee7tfmWD48o</a></p> <p>-Mike Tsouris</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-190287</guid>
				<title>Scaled / Rotated Boxes seem to not detect collisions properly</title>
				<link>http://jiglibx.wikidot.com/forum/t-190287/scaled-rotated-boxes-seem-to-not-detect-collisions-properly</link>
				<description>Using a scene designer, i lay out boxes (using a modified &#039;BoxActor&#039; class), but if the box is scaled and then rotated, the collision seems to not detect right.

Also, lots of screen shots and a video of the Physics Library in action!</description>
				<pubDate>Tue, 20 Oct 2009 06:29:58 +0000</pubDate>
				<wikidot:authorName>Mike Tsouris</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>First off, great job and thanks for saving me tons of time in my game development. I've been using JigLibX for about 3 months now. I quit my job and this is my new full time job, ha.</p> <p>Now, a quick background of my situation. I'm making a game engine, a game designer tool, and a GAME.</p> <p>I use a combination of OcTrees and simple geometry to build an entire 'collision scene'. So, some "stairs" might be an OcTree of a model, but for some other elements, i'd prefer simply place a model (just a regular model) and then place a collision geometry over it. In the later case, in the actual game, the model and it's collision are NOT associated. Also in this case, the object is NEVER meant to move. An example would be, if i have a row of ten 'tree models', i'd prefer to just create ONE collision box that surrounds all of them. No need to have 10 collision objects right next to each other when an 'invisible wall' is all i need.</p> <p>So here is what my designer looks like: <a href="http://files.tsouris.net/i/basicdesigner/_jpg.aspx">http://files.tsouris.net/i/basicdesigner/_jpg.aspx</a></p> <p><a href="http://files.tsouris.net/i/choosetype/_jpg.aspx">http://files.tsouris.net/i/choosetype/_jpg.aspx</a></p> <p>You will see that i use OcTree for some stairs, and a big cave that you can walk in. However, the Bridge is actually many instances of one model (a small portion of bridge) and then one collision box is layed over it, so the character can walk on it.</p> <p>Here is a closer look: <a href="http://files.tsouris.net/i/goodbox/_jpg.aspx">http://files.tsouris.net/i/goodbox/_jpg.aspx</a></p> <p>It just so happens THAT part of the bridge doesn't require me to rotate the box, just scale it into a rectangle (look at the top left for the position, rotation, scale). So it has ZERO rotation and works perfect.</p> <p>The bridge that splits off from the middle, is another box that DOES need to be rotated. This collision never works for me. <a href="http://files.tsouris.net/i/badbox/_jpg.aspx">http://files.tsouris.net/i/badbox/_jpg.aspx</a> (don't mind what looks like TWO boxes, it's something else)</p> <p>I notice when the scaling isn't so drastic, and the rotation is not gradual, (more like 90 degrees on an axis or something), i don't have this problem. But when i stretch long, and rotate just a little, the Physics Engine loses track of it.</p> <p>Maybe i'm just using it in a way that it wasn't meant to be used.</p> <p>And in case you're wondering how i am applying these transforms……. Here is an example……</p> <p>To set scale of a box:</p> <p>Box box = new Box(Vector3.Zero, Matrix.Identity, MY_SCALE_PROPERTY);<br /> _skin.AddPrimitive(box, materialProperties);</p> <p>To Position the Box:</p> <p>_body.MoveTo(MY_POSITION_PROPERTY, Matrix.Identity);</p> <p>And to apply to rotation:</p> <p>_body.Orientation = Matrix.CreateFromQuaternion(MY_ROTATION_PROPERTY);</p> <p>Maybe you'd be interested in collaborating with me to create the 'Official Scene Designer' for JigLibX, since i've done most of the work already. You can see the game in action here: <a href="http://www.youtube.com/watch?v=QMe1A3-kRfM">http://www.youtube.com/watch?v=QMe1A3-kRfM</a></p> <p>(every single thing you see is loaded from XML that is created with my scene designer, even the particle systems, skyBox and moveable props)</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-190009</guid>
				<title>Collision with &lt;Any from class&gt;</title>
				<link>http://jiglibx.wikidot.com/forum/t-190009/collision-with-any-from-class</link>
				<description>huh?</description>
				<pubDate>Mon, 19 Oct 2009 13:34:01 +0000</pubDate>
				<wikidot:authorName>Hunter</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>i want to make a character abel to pick up a cube.<br /> how do i tell the character that when it collides with any from the cube class that it is able to pick it up?<br /> i tried this</p> <div class="code"> <pre> <code>foreach (CollisionInfo info in actor.Skin.Collisions) { Vector3 N = info.DirToBody0; Type collideType = info.GetType(); if (info.SkinInfo.Skin0.OnCollisionEvent(actor.Skin, kubus.Skin)) { System.Diagnostics.Trace.WriteLine("ID HIT THAT"); if (keyboard.IsKeyDown(Keys.LeftShift) &amp;&amp; actor.playerNumber == 1 &amp;&amp; actor.isPickingUp == false) { kubus.BeingCarried(); kubus.CarriedBy = actor; kubus.isCarried = true; } } }</code> </pre></div> <p>but it seems i get that message Id Hit that all the time when the game starts.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189749</guid>
				<title>Velocity constraints with forces</title>
				<link>http://jiglibx.wikidot.com/forum/t-189749/velocity-constraints-with-forces</link>
				<description></description>
				<pubDate>Sun, 18 Oct 2009 14:58:16 +0000</pubDate>
				<wikidot:authorName>jacc</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>This is my problem: I have a spherical-ish world that is represented by a TriangleMesh. I am manually applying the force of gravity for each interact-able physics body in the direction of towards the centre of spherical-ish world. Now the problem is that the main controllable character (represented by a sphere to JigLibX) needs to have their velocity constrained but only in the directions that are tangential to the surface of the spherical world. Therefore I need the effects of gravity to still be applied to the main character while their velocity is constrained in directions that are orthogonal to the gravity vector. Basically how do I do this?</p> <p>What I have tried:</p> <ul> <li>The first thing I have tried was to apply the gravity force like normal to the character body and then with a bit of maths constrain the velocity of the body by manipulating the velocity component of the body directly. This did not work because although the velocity was constrained, the force of gravity is being ignored internally by JigLibX. I'm unsure why but I'm guessing if you manipulate the velocity manually forces do not get applied?</li> </ul> <ul> <li>The second thing I tried was to apply the velocity of gravity to the character body instead of as a force. This approach works but in the future I will need to apply other forces to the character and using velocities will not be appropriate, essentially this puts a lot of extra work on me for how the game should be designed - which JigLibX should take care of. Also I've noticed that sometimes my character body falls through the world TriangleMesh sometimes when using this approach.</li> </ul> <ul> <li>The final thing I have looked at but not sure how to implement it ConstraintVelocity class. I'm guessing this is what I want but I could not find good usage of it. Now I know this works but how would I go about constrain-ing the velocity of a body in 2 directions; directions that are continuously changing according to the surface of the world geometry?</li> </ul> <p>Thanks for any help</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189705</guid>
				<title>Lost!! Adding a static City.</title>
				<link>http://jiglibx.wikidot.com/forum/t-189705/lost-adding-a-static-city</link>
				<description>Very much stuck! Trying to add a city model but no idea where drawing is done!!</description>
				<pubDate>Sun, 18 Oct 2009 13:17:26 +0000</pubDate>
				<wikidot:authorName>Michael</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi There,</p> <p>I am SO stuck! I have no idea what I'm doing in this as there is no real documentation and I'm completely lost. I have my solution which has the xna ship and my 3d city model I want to start using the physic engine to introduce collision. So I'm trying to add my 3d city to the JigLIbX example solution so I have done this:</p> <p>TestObject city = new TestObject(this, CityModel);<br /> this.Components.Add(city);<br /> city.Enabled = true;</p> <p>I have tried so many objects I don't know which one I should be using… do I have to write my own? When I do this nothing seems to happen, where is it drawn? none of this is explained. I've tried with other engines and I am equally as lost :( Help would be much appriciated.</p> <p>Thanks</p> <p>Michael</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189681</guid>
				<title>Easy stuff: rotating a model</title>
				<link>http://jiglibx.wikidot.com/forum/t-189681/easy-stuff:rotating-a-model</link>
				<description>So how to...?</description>
				<pubDate>Sun, 18 Oct 2009 12:09:30 +0000</pubDate>
				<wikidot:authorName>Blackhowl</wikidot:authorName>				<wikidot:authorUserId>391250</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>So I want to make a character face left the moment I press left, and face right the moment I press right.<br /> This must be easy, yet it eludes me how to do it…<br /> (Oh, and the left key is kept down, so I want the model to only switch the moment you press left or else keep repeating to face left, instead of saying rotate 180 degrees).</p> <p>Also I want to stop my player class from toppling over when it bumps into something. For example, I have a cube where the player runs into and I don't want the player model to fall over forwards. Any way to turn that off, without turning off side-rotating for facing a direction?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189566</guid>
				<title>Updated Hinge Controller</title>
				<link>http://jiglibx.wikidot.com/forum/t-189566/updated-hinge-controller</link>
				<description>Rotated actors for use on hinge fix.</description>
				<pubDate>Sun, 18 Oct 2009 04:54:54 +0000</pubDate>
				<wikidot:authorName>PGlynn</wikidot:authorName>				<wikidot:authorUserId>387675</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>this comment was part of the HingeJoint controller</p> <div class="code"> <pre> <code>/// TODO at the moment the bodies should be unrotated when this is /// called...</code> </pre></div> <p>trying to setup a model bone heirarchy made this a problem because it wouldnt really be ideal to have to un orientate everything so i made this new controller that does account for rotation.</p> <p>it has two initialize functions, one for relative and one for world based positions on the hinge and hingeDirection( note: i think hingeAxis is misleading because its not actually the rotation axis as you would think. Its actually the direction of the hinge and where the fwd and bck angles take place from )</p> <p>i would like to set the up so you could enter the axis of rotation, but havnt been able to figure that out yet. I'm still not sure if the MAX_HINGE_ANGLE needs to be in place. anyways heres my updated class for anyone who is intrested.</p> <div class="code"> <pre> <code>#region Using Statements using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using JigLibX.Math; #endregion namespace JigLibX.Physics { /// &lt;summary&gt; /// Implements a simple hinge between two rigid bodies. The bodies /// should be in a suitable configuration when this joint is created. /// &lt;/summary&gt; public class WorldHingeJoint : Joint { private Vector3 hingeDirection; private Vector3 hingePosRel0; private Body body0; private Body body1; private bool usingLimit; private bool hingeEnabled; private bool broken; private float damping; private float extraTorque; // allow extra torque applied per update /// PGlynn : from original JigLib hingejoint.hpp /// TODO at the moment the bodies should be unrotated when this is /// called... No angle limit if fwd &gt; MAX_HINGE_ANGLE_LIMIT after /// calling initialise the joint will be functional - /// i.e. registered... so the bodies should be registered too! If /// damping &gt; 0 then the joint will be damped such that the torque /// is equal to -damping * relative-rotation of the bodies /// involved. The actual value is clamped to prevent instability. const float MAX_HINGE_ANGLE_LIMIT = 150.0f; private ConstraintPoint mMidPointConstraint; private ConstraintMaxDistance[] mSidePointConstraints; private ConstraintMaxDistance mMaxDistanceConstraint; /// &lt;summary&gt; /// default constructor so you can initialise this joint later /// &lt;/summary&gt; public WorldHingeJoint() { } static Matrix GetBodyTransformMatrix(Body body) { Matrix ret = body.Orientation; ret.Translation = body.Position; return ret; } // works like the standard jiglib Initialise public void InitializeRelative(Body body0, Body body1, Vector3 hingeDirectionRel0, Vector3 hingePosRel0, float hingeHalfWidth, float hingeFwdAngle, float hingeBckAngle, float sidewaysSlack, float damping) { InitializeWorld(body0, body1, Vector3.TransformNormal(hingeDirectionRel0, body0.Orientation), Vector3.Transform(hingePosRel0, GetBodyTransformMatrix(body0)), hingeHalfWidth, hingeFwdAngle, hingeBckAngle, sidewaysSlack, damping); } // hingePos is a world coordinate no longer relative. public void InitializeWorld(Body body0, Body body1, Vector3 hingeDirection, Vector3 hingePos, float hingeHalfWidth, float hingeFwdAngle, float hingeBckAngle, float sidewaysSlack, float damping) { this.body0 = body0; this.body1 = body1; hingeDirection.Normalize(); this.hingeDirection = hingeDirection; //this.hingePosRel0 = hingePosRel0; this.usingLimit = false; this.damping = damping; // tScalar allowedDistance = 0.005f; this.hingeDirection.Normalize(); Matrix body0InverseTransform = Matrix.Invert(GetBodyTransformMatrix(body0));//.TransformMatrix; Matrix body1InverseTransform = Matrix.Invert(GetBodyTransformMatrix(body1)); Vector3.Transform(ref hingePos, ref body0InverseTransform, out this.hingePosRel0); Vector3 hingePosRel1;// = body0.Position + hingePosRel0 - body1.Position; Vector3.Transform(ref hingePos, ref body1InverseTransform, out hingePosRel1); Vector3 hingeAxisRel0; Vector3 hingeAxisRel1; Vector3.TransformNormal(ref hingeDirection, ref body0InverseTransform, out hingeAxisRel0); Vector3.TransformNormal(ref hingeDirection, ref body1InverseTransform, out hingeAxisRel1); // generate the two positions relative to each body Vector3 relPos0a = hingePosRel0 + hingeHalfWidth * hingeAxisRel0; Vector3 relPos0b = hingePosRel0 - hingeHalfWidth * hingeAxisRel0; Vector3 relPos1a = hingePosRel1 + hingeHalfWidth * hingeAxisRel1; Vector3 relPos1b = hingePosRel1 - hingeHalfWidth * hingeAxisRel1; float timescale = 1.0f / 20.0f; float allowedDistanceMid = 0.005f; float allowedDistanceSide = sidewaysSlack * hingeHalfWidth; mSidePointConstraints = new ConstraintMaxDistance[2]; mSidePointConstraints[0] = new ConstraintMaxDistance(); mSidePointConstraints[1] = new ConstraintMaxDistance(); mSidePointConstraints[0].Initialise(body0, relPos0a, body1, relPos1a, allowedDistanceSide); mSidePointConstraints[1].Initialise(body0, relPos0b, body1, relPos1b, allowedDistanceSide); mMidPointConstraint = new ConstraintPoint(); mMidPointConstraint.Initialise(body0, hingePosRel0, body1, hingePosRel1, allowedDistanceMid, timescale); if (hingeFwdAngle &lt;= MAX_HINGE_ANGLE_LIMIT) // MAX_HINGE_ANGLE_LIMIT { // choose a direction that is perpendicular to the hinge Vector3 perpDir = Vector3.Up; if (Vector3.Dot(perpDir, hingeDirection) &gt; 0.1f) perpDir = Vector3.Right; // now make it perpendicular to the hinge Vector3 sideAxis = Vector3.Cross(hingeDirection, perpDir); perpDir = Vector3.Cross(sideAxis, hingeDirection); perpDir.Normalize(); // the length of the "arm" TODO take this as a parameter? what's // the effect of changing it? float len = 10.0f * hingeHalfWidth; // Choose a position using that dir. this will be the anchor point // for body 0. relative to hinge Vector3 hingeRelAnchorPos0 = perpDir * len; // anchor point for body 2 is chosen to be in the middle of the // angle range. relative to hinge float angleToMiddle = 0.5f * (hingeFwdAngle - hingeBckAngle); Vector3 hingeRelAnchorPos1 = Vector3.Transform(hingeRelAnchorPos0, Matrix.CreateFromAxisAngle(hingeDirection, MathHelper.ToRadians(-angleToMiddle))); // work out the "string" length float hingeHalfAngle = 0.5f * (hingeFwdAngle + hingeBckAngle); float allowedDistance = len * 2.0f * (float)System.Math.Sin(MathHelper.ToRadians(hingeHalfAngle * 0.5f)); //Vector3 hingePos = body1.Position + hingePosRel0; Vector3 relPos0c = Vector3.Transform(hingePos + hingeRelAnchorPos0, body0InverseTransform);// -body0.Position; Vector3 relPos1c = Vector3.Transform(hingePos + hingeRelAnchorPos1, body1InverseTransform);// -body1.Position; mMaxDistanceConstraint = new ConstraintMaxDistance(); mMaxDistanceConstraint.Initialise(body0, relPos0c, body1, relPos1c, allowedDistance); usingLimit = true; } if (this.damping &lt;= 0.0f) this.damping = -1.0f; // just make sure that a value of 0.0 doesn't mess up... else this.damping = MathHelper.Clamp(this.damping, 0, 1); } /// &lt;summary&gt; /// Register the constraints /// &lt;/summary&gt; public void EnableHinge() { if (hingeEnabled) return; if (body0 != null) { mMidPointConstraint.EnableConstraint(); mSidePointConstraints[0].EnableConstraint(); mSidePointConstraints[1].EnableConstraint(); if (usingLimit &amp;&amp; !broken) mMaxDistanceConstraint.EnableConstraint(); EnableController(); } hingeEnabled = true; } /// &lt;summary&gt; /// deregister the constraints /// &lt;/summary&gt; public void DisableHinge() { if (!hingeEnabled) return; if (body0 != null) { mMidPointConstraint.DisableConstraint(); mSidePointConstraints[0].DisableConstraint(); mSidePointConstraints[1].DisableConstraint(); if (usingLimit &amp;&amp; !broken) mMaxDistanceConstraint.DisableConstraint(); DisableController(); } hingeEnabled = false; } /// &lt;summary&gt; /// Just remove the limit constraint /// &lt;/summary&gt; public void Break() { if (broken) return; if (usingLimit) mMaxDistanceConstraint.DisableConstraint(); broken = true; } /// &lt;summary&gt; /// Just enable the limit constraint /// &lt;/summary&gt; public void Mend() { if (!broken) return; if (usingLimit) mMaxDistanceConstraint.EnableConstraint(); broken = false; } public override void UpdateController(float dt) { if (body0 == null || body1 == null) return; //Assert(0 != mBody0); //Assert(0 != mBody1); if (damping &gt; 0.0f) { // Some hinges can bend in wonky ways. Derive the effective hinge axis // using the relative rotation of the bodies. Vector3 hingeAxis = body1.AngularVelocity - body0.AngularVelocity; JiggleMath.NormalizeSafe(ref hingeAxis); float angRot1;// Vector3.Dot(ref body0.transformRate.AngularVelocity, ref hingeAxis, out angRot1); float angRot2; Vector3.Dot(ref body1.transformRate.AngularVelocity, ref hingeAxis, out angRot2); float avAngRot = 0.5f * (angRot1 + angRot2); float frac = 1.0f - damping; float newAngRot1 = avAngRot + (angRot1 - avAngRot) * frac; float newAngRot2 = avAngRot + (angRot2 - avAngRot) * frac; Vector3 newAngVel1;// = body0.AngVel + (newAngRot1 - angRot1) * hingeAxis; Vector3.Multiply(ref hingeAxis, newAngRot1 - angRot1, out newAngVel1); Vector3.Add(ref newAngVel1, ref body0.transformRate.AngularVelocity, out newAngVel1); Vector3 newAngVel2;// = body1.AngVel + (newAngRot2 - angRot2) * hingeAxis; Vector3.Multiply(ref hingeAxis, newAngRot2 - angRot2, out newAngVel2); Vector3.Add(ref newAngVel2, ref body1.transformRate.AngularVelocity, out newAngVel2); body0.AngularVelocity = newAngVel1; body1.AngularVelocity = newAngVel2; } // the extra torque if (extraTorque != 0.0f) { Vector3 torque1;// = extraTorque * Vector3.Transform(hingeAxis, body0.Orientation); Vector3.Transform(ref hingeDirection, ref body0.transform.Orientation, out torque1); Vector3.Multiply(ref torque1, extraTorque, out torque1); body0.AddWorldTorque(torque1); body1.AddWorldTorque(-torque1); } } public bool HingeEnabled { get { return hingeEnabled; } } /// &lt;summary&gt; /// Are we broken /// &lt;/summary&gt; public bool IsBroken { get { return broken; } } } }</code> </pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189516</guid>
				<title>Ray testing porblem</title>
				<link>http://jiglibx.wikidot.com/forum/t-189516/ray-testing-porblem</link>
				<description></description>
				<pubDate>Sat, 17 Oct 2009 20:12:00 +0000</pubDate>
				<wikidot:authorName>jhow</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I am trying to make my car drive on its own using rays projecting out from its center. Right now i have boxes positioned where the end of each ray should be. I am using segment intersect passing it a segment with code as follows. It says hit if i have the car facing forward. Only it is not hitting anything. Any help?</p> <p>Vector3 box1front = (carObject.PhysicsBody.Orientation.Right * 12) + (carObject.PhysicsBody.Orientation.Up * 2);<br /> Vector3.Transform(box1front, carObject.PhysicsBody.Orientation);<br /> box1.PhysicsBody.Position = carObject.PhysicsBody.Position + box1front;</p> <p>physicSystem.CollisionSystem.SegmentIntersect(out frac1, out skin1, out pos1, out normal1,<br /> new Segment(box1.PhysicsBody.Position, carObject.PhysicsBody.Position), pred1);</p> <p>if (skin1 == triObj.PhysicsSkin)<br /> {<br /> Console.WriteLine("hit");<br /> }</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-189298</guid>
				<title>Catching collisions from objects that aren&#039;t at rest?</title>
				<link>http://jiglibx.wikidot.com/forum/t-189298/catching-collisions-from-objects-that-aren-t-at-rest</link>
				<description>The following method doesn&#039;t work for me...</description>
				<pubDate>Fri, 16 Oct 2009 11:20:59 +0000</pubDate>
				<wikidot:authorName>Geoff</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>If I use the following code to catch collisions, how can I catch only those collisions that aren't happening when a body is at rest? info.PointInfo[i].MinSeparationVel != 0 doesn't work?!</p> <div class="code"> <pre> <code> physics_Engine.CollisionSystem.DetectAllCollisions(body_List, collision_Functor, null, 0.05f); // Check if there is new collision information if (collision_Info.Count &gt; 0) { foreach (CollisionInfo info in collision_Info) { for (int i = 0; i &lt; info.NumCollPts; i++) { // Only detect objects that aren't at rest if (info.PointInfo[i].MinSeparationVel != 0) { Console.WriteLine(info.PointInfo[i].MinSeparationVel); } } } // Clear the list to get only new collision information next frame collision_Info.Clear(); }</code> </pre></div> <p>Thank you.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-188737</guid>
				<title>Lower Scaled Primitives Cause Jittery Physics Against Other Primitives</title>
				<link>http://jiglibx.wikidot.com/forum/t-188737/lower-scaled-primitives-cause-jittery-physics-against-other-primitives</link>
				<description>So far i can conclude the Box Primitive.</description>
				<pubDate>Thu, 15 Oct 2009 00:14:30 +0000</pubDate>
				<wikidot:authorName>PGlynn</wikidot:authorName>				<wikidot:authorUserId>387675</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Right now i'm only gonna explain the box. since its the only primitive i've had issues with so far.</p> <p>So if you have a box primtiive that is either set as immovable or in a standalone collisionskin the physics are incredibly jittery between the two, causing the body/collision skin to never go inactive.</p> <p>I've tested this code in the JiggleGame.cs file to make sure it was non of the stuff in my game environment. I don't really consider this these to be small boxes ( in the code below these would be 10 centimeters by 30.. not really small ).</p> <p>So i have a immovable box that is 4x1x4 meters and the jinga boxes have been scaled 10%. Just to be clear this issue is with a box being used as a immoveable. It doesnt seem to happen with things larger than.. i dont know what size but i know 1x1x1 is somewhat stable.</p> <p>To test this replace the CreateScene6 with this function below.</p> <div class="code"> <div class="hl-main"> <pre> <span class="hl-code"> </span><span class="hl-reserved">private</span><span class="hl-code"> </span><span class="hl-types">void</span><span class="hl-code"> </span><span class="hl-identifier">CreateScene6</span><span class="hl-brackets">()</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxFloor</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">4</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">4</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-identifier">Vector3</span><span class="hl-code">.</span><span class="hl-identifier">Down</span><span class="hl-code"> * </span><span class="hl-number">14</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-comment">// PG: test of immovable body</span><span class="hl-code"> </span><span class="hl-identifier">boxFloor</span><span class="hl-code">.</span><span class="hl-identifier">PhysicsBody</span><span class="hl-code">.</span><span class="hl-identifier">Immovable</span><span class="hl-code"> = </span><span class="hl-reserved">true</span><span class="hl-code">; </span><span class="hl-mlcomment">/* PG: test of collision skin without body. boxFloor.PhysicsBody.DisableBody(); boxFloor.PhysicsBody.CollisionSkin.Owner = null; physicSystem.CollisionSystem.AddCollisionSkin(boxFloor.PhysicsBody.CollisionSkin); */</span><span class="hl-code"> </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxFloor</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-types">float</span><span class="hl-code"> </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> = </span><span class="hl-number">0.1</span><span class="hl-identifier">f</span><span class="hl-code">; </span><span class="hl-identifier">Vector3</span><span class="hl-code"> </span><span class="hl-identifier">PositionOffset</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-code">-</span><span class="hl-identifier">JingaScale</span><span class="hl-code">, -</span><span class="hl-number">12</span><span class="hl-code">, -</span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">i</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code"> &lt; </span><span class="hl-number">10</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code"> += </span><span class="hl-number">2</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj0</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">3</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj1</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">3</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj2</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">3</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">2</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj0</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj1</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj2</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj3</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">3</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code"> + </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj4</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">3</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code"> + </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">BoxObject</span><span class="hl-code"> </span><span class="hl-identifier">boxObj5</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">3</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code"> + </span><span class="hl-number">1</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">2</span><span class="hl-brackets">)</span><span class="hl-code"> * </span><span class="hl-identifier">JingaScale</span><span class="hl-code"> + </span><span class="hl-identifier">PositionOffset</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj3</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj4</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">boxObj5</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-brackets">}</span><span class="hl-code"> </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">i</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code"> &lt; </span><span class="hl-number">10</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-identifier">CylinderObject</span><span class="hl-code"> </span><span class="hl-identifier">cyl</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">CylinderObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-number">0.5</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">1.0</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">5</span><span class="hl-code">, </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">1.01</span><span class="hl-identifier">f</span><span class="hl-code"> - </span><span class="hl-number">14.2</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-identifier">cylinderModel</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-identifier">cyl</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-brackets">}</span><span class="hl-code"> </span><span class="hl-identifier">RagdollObject</span><span class="hl-code"> </span><span class="hl-identifier">rgd</span><span class="hl-code">; </span><span class="hl-comment">// professional stuntmen, noone gets hurt!</span><span class="hl-code"> </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">e</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">e</span><span class="hl-code"> &lt; </span><span class="hl-number">2</span><span class="hl-code">; </span><span class="hl-identifier">e</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">i</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code"> &lt; </span><span class="hl-number">2</span><span class="hl-code">; </span><span class="hl-identifier">i</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-identifier">rgd</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">RagdollObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">capsuleModel</span><span class="hl-code">, </span><span class="hl-identifier">sphereModel</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-identifier">RagdollObject</span><span class="hl-code">.</span><span class="hl-identifier">RagdollType</span><span class="hl-code">.</span><span class="hl-identifier">Simple</span><span class="hl-code">, </span><span class="hl-number">1.0</span><span class="hl-identifier">f</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">rgd</span><span class="hl-code">.</span><span class="hl-identifier">Position</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-identifier">e</span><span class="hl-code"> * </span><span class="hl-number">2</span><span class="hl-code">, -</span><span class="hl-number">14</span><span class="hl-code">, </span><span class="hl-number">10</span><span class="hl-code"> + </span><span class="hl-identifier">i</span><span class="hl-code"> * </span><span class="hl-number">2</span><span class="hl-brackets">)</span><span class="hl-code">; </span><span class="hl-identifier">rgd</span><span class="hl-code">.</span><span class="hl-identifier">PutToSleep</span><span class="hl-brackets">()</span><span class="hl-code">; </span><span class="hl-brackets">}</span><span class="hl-code"> </span><span class="hl-brackets">}</span><span class="hl-code"> </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">x</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">x</span><span class="hl-code"> &lt; </span><span class="hl-number">8</span><span class="hl-code">; </span><span class="hl-identifier">x</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code"> </span><span class="hl-reserved">for</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-types">int</span><span class="hl-code"> </span><span class="hl-identifier">y</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-identifier">y</span><span class="hl-code"> &lt; </span><span class="hl-number">3</span><span class="hl-code">; </span><span class="hl-identifier">y</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-identifier">y</span><span class="hl-code"> % </span><span class="hl-number">2</span><span class="hl-code"> == </span><span class="hl-number">0</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-identifier">x</span><span class="hl-code"> * </span><span class="hl-number">1.01</span><span class="hl-identifier">f</span><span class="hl-code"> - </span><span class="hl-number">10.0</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-identifier">y</span><span class="hl-code"> * </span><span class="hl-number">1.01</span><span class="hl-identifier">f</span><span class="hl-code"> - </span><span class="hl-number">14.5</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-brackets">)))</span><span class="hl-code">; </span><span class="hl-reserved">else</span><span class="hl-code"> </span><span class="hl-reserved">this</span><span class="hl-code">.</span><span class="hl-identifier">Components</span><span class="hl-code">.</span><span class="hl-identifier">Add</span><span class="hl-brackets">(</span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">BoxObject</span><span class="hl-brackets">(</span><span class="hl-reserved">this</span><span class="hl-code">, </span><span class="hl-identifier">boxModel</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-identifier">Matrix</span><span class="hl-code">.</span><span class="hl-identifier">Identity</span><span class="hl-code">, </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">Vector3</span><span class="hl-brackets">(</span><span class="hl-identifier">x</span><span class="hl-code"> * </span><span class="hl-number">1.01</span><span class="hl-identifier">f</span><span class="hl-code"> - </span><span class="hl-number">10.5</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-identifier">y</span><span class="hl-code"> * </span><span class="hl-number">1.01</span><span class="hl-identifier">f</span><span class="hl-code"> - </span><span class="hl-number">14.5</span><span class="hl-identifier">f</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-brackets">)))</span><span class="hl-code">; </span><span class="hl-brackets">}</span><span class="hl-code"> </span><span class="hl-brackets">}</span> </pre></div> </div> <p>BTW, my understanding is JigLibX's units are meters. So i really think it would be a good idea for all the examples to use something to scale. maybe at least have the ragdolls or car being to scale, Unless i'm incorrect about meters being the scale.</p> <p><strong>Also</strong> This issue does not stand out untill you apply the intertia tensor to the smaller bodies (i'm using GetPrimitiveProperties). My thoughts on that: the values of the matrix are very small like ~ 0.1e-20 .</p> <p>I'm really hoping I will not end up having to rescale my entire project to get stuff to stop bouncing. I'm planning on having fast moving objects and the 300 meter/s velocity cap i read about in the forums might get in the way.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-188550</guid>
				<title>Basic World</title>
				<link>http://jiglibx.wikidot.com/forum/t-188550/basic-world</link>
				<description>Someone got it working?</description>
				<pubDate>Wed, 14 Oct 2009 02:19:16 +0000</pubDate>
				<wikidot:authorName>Lucas</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Someone got the Basic World tutorial working? Here(XNA 3.0.) It just don't work. There are errors like in the AddPrimitive, and many other thing. Someone could send the file for me please?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-187987</guid>
				<title>ExternalData on CollisionSkin</title>
				<link>http://jiglibx.wikidot.com/forum/t-187987/externaldata-on-collisionskin</link>
				<description>could be enabled.</description>
				<pubDate>Sat, 10 Oct 2009 22:54:35 +0000</pubDate>
				<wikidot:authorName>PGlynn</wikidot:authorName>				<wikidot:authorUserId>387675</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hey, I just wanted to say the ExternalData member in CollisionSkin should probably made public. It would be nice to have.</p> <p>I realize its being used in the grid collision system. what i did to enable it in my build is i just renamed it to InternalData in the collision skin and refractored it. then made a new ExternalData member.</p> <p>I was wondering if this is not a good idea by the way its set up or not. I use the Body.ExternalData member but stuff like ray casting i can't always count on there being a body to get from the CollisionSkin since i use CollisionSkins without bodies for immovable collisions.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185969</guid>
				<title>JibLibX deployed to Windows requires .NET 3.5?</title>
				<link>http://jiglibx.wikidot.com/forum/t-185969/jiblibx-deployed-to-windows-requires-net-3-5</link>
				<description></description>
				<pubDate>Fri, 02 Oct 2009 06:21:11 +0000</pubDate>
				<wikidot:authorName>Adam Kane</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Is it correct that an end-user must have .NET 3.5 installed in order to run a finished game that uses JigLibX?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185968</guid>
				<title>Making JigLibX Games</title>
				<link>http://jiglibx.wikidot.com/forum/t-185968/making-jiglibx-games</link>
				<description></description>
				<pubDate>Fri, 02 Oct 2009 06:19:25 +0000</pubDate>
				<wikidot:authorName>neverdowell</wikidot:authorName>				<wikidot:authorUserId>273487</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>As i floated through posts, i mentioned over and over again the same issues und questions. If someone has figured out something about using JigLibX, PLEASE post your code or write a small tutorial. There is so much knowledge around, that could and should be shared. JigLibX is an amazing framework, but there is a lack of good advices. Make JigLibX better and help whole community by writing tutorials or just post special purpose code with some comments. First it won't help yourself, but as more people post hints, it will be paid off. I don't want you to bespeak your engine secrets. Rather post solutions to known issues or workarounds.</p> <p>let's make more out of JigLibX. Thanks.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185850</guid>
				<title>JigLibX on a Windows Form Example</title>
				<link>http://jiglibx.wikidot.com/forum/t-185850/jiglibx-on-a-windows-form-example</link>
				<description>Possible to host an XNA user control on a windows form that is running JigLibX</description>
				<pubDate>Thu, 01 Oct 2009 16:45:09 +0000</pubDate>
				<wikidot:authorName>Adam Kane</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hello,</p> <p>I imagine there would be no reason that JigLibX couldn't run in the context of an XNA user control running on a windows form. Kind of like the JigLibX equivalent of the WinForms 1 example on the creator's club: <a href="http://creators.xna.com/en-US/sample/winforms_series1">http://creators.xna.com/en-US/sample/winforms_series1</a></p> <p>Has anyone done this and verified that it works? Is there an example posted somewhere?</p> <p>If not, I'll create and test an example and report back.</p> <p>Thanks,</p> <p>Adam</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185841</guid>
				<title>Changing &quot;Assembly Name&quot; causes HeightMapObject to throw &quot;NullReferenceException&quot;</title>
				<link>http://jiglibx.wikidot.com/forum/t-185841/changing-assembly-name-causes-heightmapobject-to-throw-nullreferenceexception</link>
				<description></description>
				<pubDate>Thu, 01 Oct 2009 15:33:16 +0000</pubDate>
				<wikidot:authorName>RaZeR</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Please help me ;(<br /> I started to making a game based on JigLibX sample. When i changing Assembly Name from "JigLibGame" to my name this line (line №27) in HeightMapObject.cs throws me a NullReferenceException:</p> <div class="code"> <pre> <code>Array2D field = new JigLibX.Utils.Array2D(heightMapInfo.heights.GetUpperBound(0), heightMapInfo.heights.GetUpperBound(1));</code> </pre></div> <p>I tried to change the position and declarations in this module, but no result. How to fix that?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185241</guid>
				<title>Crash due to skins swaps in DetectFunctors  Title is required</title>
				<link>http://jiglibx.wikidot.com/forum/t-185241/crash-due-to-skins-swaps-in-detectfunctors-title-is-required</link>
				<description></description>
				<pubDate>Mon, 28 Sep 2009 20:30:23 +0000</pubDate>
				<wikidot:authorName>luis_acebal</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Crash in PreProcessCollisions in HandleAllConstrains motivated by the fact that the PreProcessCollisions (All almost all other functions in PhysicSystem) expects Collision.SkinInfo.Skin0.Owner != null. But some DetectFunctors swap skins during detection (All not symetric ones) but never restores previous state. So if the input Skin1 without Body owner is swaped during detection then all the calls expecting an owner in Skin0 are destined to fail.</p> <p>The solution is as simple as pass the original CollDetectInfo (infoOrig) to the collision CollisionFunctor.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-185010</guid>
				<title>Other 3D Engine</title>
				<link>http://jiglibx.wikidot.com/forum/t-185010/other-3d-engine</link>
				<description>Using JigLibX with with engines other than XNA.</description>
				<pubDate>Sun, 27 Sep 2009 17:38:02 +0000</pubDate>
				<wikidot:authorName>lzdude69</wikidot:authorName>				<wikidot:authorUserId>35058</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>I was wondering if it was possible (or intended) to use JigLibX on platforms other then XNA. I've got it to build against my engine, and even run (applying gravity to a cube), although I'm unsure of integrating it further. This is at least promising to me:P So far the only link I see to XNA is it uses the Matrix and Vector* classes; In which case using it from non-XNA apps would be no problem.</p> <p>Thanks!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-184822</guid>
				<title>Constrain a capsule to not leave surface of trianglemesh</title>
				<link>http://jiglibx.wikidot.com/forum/t-184822/constrain-a-capsule-to-not-leave-surface-of-trianglemesh</link>
				<description>i want to keep the momentum of my object from making it go airborne when it goes over small bumps, or sharp changes in Y position (it should stay firmly planted)</description>
				<pubDate>Sat, 26 Sep 2009 13:20:37 +0000</pubDate>
				<wikidot:authorName>Jasper</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi! What is the best way to constrain a capsule so that it will not leave the surface of a trianglemesh? I have a small cart object modeled by a capsule, and whenever it rolls over hills even at moderate speed it launches into the air at the peak of the hill. I would love to be able to keep the cart kind of "locked on" to the trainglemesh it is driving on, but also be able to turn this off for ramps that it should jump off of.</p> <p>I have tried just cranking up a downward Y body force, but this has the effect of slowing the cart down in every direction.</p> <p>Ideally I would use a constraint, and I could toggle it. I just can't seem to figure it out.</p> <p>Any help would be greatly appreciated!</p> <p>Thank you,<br /> Jasper</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-184751</guid>
				<title>Character Movement</title>
				<link>http://jiglibx.wikidot.com/forum/t-184751/character-movement</link>
				<description></description>
				<pubDate>Fri, 25 Sep 2009 21:40:02 +0000</pubDate>
				<wikidot:authorName>Dheeraj Mehta</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi Everyone,</p> <p>first of all, thanks a lot for JigLibX and its frequent users to make such a beautiful engine. I am new at XNA and JigLibX, and trying to implement a little physics. I have already got 2 boxes on a plane which detect collision and respond to gravity.</p> <p>However, now I want to load an FBX model and use it to detect collision. This FBX model will be the main character of my game and needs to do activities like climbing a ladder, walking up/down on a staircase etc.</p> <p>If I use a cube/capsule object for it. It will be hard to implement the above things as incorrect collisions will be detected. I thought of using triangleMesh but adding it slowed down the game like anything and I am not even sure if that implementation was correct.</p> <p>So, please help me on how to work on this.</p> <p>Thanks!!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-184526</guid>
				<title>Setting Body position and orientation from a World Matrix</title>
				<link>http://jiglibx.wikidot.com/forum/t-184526/setting-body-position-and-orientation-from-a-world-matrix</link>
				<description>How does one use an pre-calculated world matrix to set the Body.Position and Body.Orientation of a PhysicObject?</description>
				<pubDate>Thu, 24 Sep 2009 18:18:26 +0000</pubDate>
				<wikidot:authorName>khayman218</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I am using a pre-calculated world matrix to draw a JigLibX.PhysicObject. The world is calculated for another model, and I save it to draw the PhysicObject. This works well for drawing. However, I also need to set the Position and Orientation members of the PhysicObject so they can be used to determine the physics. I cannot seem to do this correctly.</p> <p>I tried setting PhsicObject.Position = word.Translation and PhysicObject.Orientation = world. That almost worked. The object is set to a position that seems related to the world, but is not the same place that the model draws.</p> <p>Is there a way I can set the Position and Orientation based on a world matrix that was previously calculated?</p> <p>Thanks in advance!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-183655</guid>
				<title>Collision response with one way</title>
				<link>http://jiglibx.wikidot.com/forum/t-183655/collision-response-with-one-way</link>
				<description>How to make A collide B but not B collide A?</description>
				<pubDate>Sun, 20 Sep 2009 21:54:09 +0000</pubDate>
				<wikidot:authorName>Camal</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>Hi,</p> <p>I have played with the Basic World Example, and I added several small cubes falling on a big one.<br /> Now, I want to make the big cube rotating on the Y axis (using a controller). I want to see a kind of centripetal forces on the small cubes, when they hit my big cube… unfortunately, nothing works correctly : the big cube is falling, or there is no centripetal effect.</p> <p>I know the effect I am tring to make is not 100% physics-compliant.<br /> I just want to introduce kind of objects that influences all the physic objects, but not influenced, such as elevators, travelators, gears, etc..</p> <p>Anyone can suggest me the best practice to do that?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-183270</guid>
				<title>Wall collisions</title>
				<link>http://jiglibx.wikidot.com/forum/t-183270/wall-collisions</link>
				<description></description>
				<pubDate>Fri, 18 Sep 2009 18:44:20 +0000</pubDate>
				<wikidot:authorName>ggblake</wikidot:authorName>				<wikidot:authorUserId>375296</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>My character interacts with objects but can actually pass thru them<br /> How do I make an object impenetrable ?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-183174</guid>
				<title>Scale not supported?</title>
				<link>http://jiglibx.wikidot.com/forum/t-183174/scale-not-supported</link>
				<description>In testing we’ve noticed that scaling objects via the body orientation (closest to full transform on bodies) not only seems to be ignored by inter-object collision, but also causes abnormal reactions to collisions.</description>
				<pubDate>Fri, 18 Sep 2009 09:44:32 +0000</pubDate>
				<wikidot:authorName>Games4U</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>In testing we’ve noticed that scaling objects via the body orientation (closest to full transform on bodies) not only seems to be ignored by inter-object collision, but also causes abnormal reactions to collisions.</p> <p>So we dug further into the JiggleGame demo to see what we’re doing wrong and noticed scaling is handled on the wrapper level and <strong>never</strong> exposed to the engine.</p> <p>On the surface this is fine for primitives, but how are static meshes supposed to be handled without the ability to scale relative to other meshes? Likewise with rotation and positioning which both also appear broken in static meshes?</p> <p>While baking down bone transforms for entire models (as static meshes) is acceptable (the data is unlikely to change) baking down entire scenes to world space is not an option when fast performance and scene flexibility is required.</p> <p>Are we doing something wrong or is this really broken?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-182399</guid>
				<title>No collisions when there should be?</title>
				<link>http://jiglibx.wikidot.com/forum/t-182399/no-collisions-when-there-should-be</link>
				<description></description>
				<pubDate>Mon, 14 Sep 2009 20:12:05 +0000</pubDate>
				<wikidot:authorName>Jesse</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I have reduced down to a very simple scene to troubleshoot this: 2 boxes and a plane.<br /> Gravity affects the boxes appropriately, but the objects never collide with the plane.<br /> Box code:<br /> position for the first box is Vector3.Zero<br /> position for the second box is (0, 0, -500)<br /> CoM in the following code block is calculated as defined in the last code block.</p> <div class="code"> <pre> <code> Vector3 scale = new Vector3(0.1f, 0.1f, 0.1f); body = new Body(); skin = new CollisionSkin(body); body.CollisionSkin = skin; // TODO Things probably want to be more than just a box Box box = new Box(-0.5f * scale, Matrix.Identity, scale); skin.AddPrimitive(box, new MaterialProperties(0.8f, 0.8f, 0.7f)); body.MoveTo(position, Matrix.Identity); skin.ApplyLocalTransform(new Transform(-CenterOfMass, Matrix.Identity)); body.EnableBody(); physics.AddBody(body);</code> </pre></div> <br /> Plane code: <div class="code"> <pre> <code> Body body = new Body(); CollisionSkin skin = new CollisionSkin(body); body.CollisionSkin = skin; JigLibX.Geometry.Plane plane = new JigLibX.Geometry.Plane(new Vector3(0, 1, 0), -20); skin.AddPrimitive(plane, new MaterialProperties(0.8f, 0.8f, 0.7f)); body.MoveTo(Vector3.Zero, Matrix.Identity); body.Immovable = true; skin.ApplyLocalTransform(new JigLibX.Math.Transform(Vector3.Zero, Matrix.Identity)); body.EnableBody(); physics.AddBody(body);</code> </pre></div> <br /> Physics Setup: <div class="code"> <pre> <code> physics = new PhysicsSystem(); physics.CollisionSystem = new CollisionSystemSAP(); #if XBOX physics.SolverType = PhysicsSystem.Solver.Normal; #endif physics.CollisionSystem.UseSweepTests = true; physics.NumCollisionIterations = 8; physics.NumContactIterations = 8; physics.NumPenetrationRelaxtionTimesteps = 15;</code> </pre></div> <br /> CoM calculation: <div class="code"> <pre> <code> public Vector3 CenterOfMass { get { PrimitiveProperties props = new PrimitiveProperties( PrimitiveProperties.MassDistributionEnum.Solid, PrimitiveProperties.MassTypeEnum.Mass, body.Mass); float mass; Vector3 CoM; Matrix it, itCoM; skin.GetMassProperties(props, out mass, out CoM, out it, out itCoM); return CoM; } }</code> </pre></div> <p>So, as I said, I have 2 boxes, which fall with gravity just fine, but never collide with my plane.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-181942</guid>
				<title>Linear velocity doesn&#039;t seem to work after first frame</title>
				<link>http://jiglibx.wikidot.com/forum/t-181942/linear-velocity-doesn-t-seem-to-work-after-first-frame</link>
				<description></description>
				<pubDate>Sat, 12 Sep 2009 08:28:02 +0000</pubDate>
				<wikidot:authorName>Nic</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>I can create a Body and give it linear velocity at that moment, which seems to work, but if I try and set that Body's linear velocity any time after that, it seems to have no effect. Setting position and orientation see to work fine, but changing Body.Velocity gets me nothing after the first frame.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://jiglibx.wikidot.com/forum/t-181802</guid>
				<title>Basic World Example</title>
				<link>http://jiglibx.wikidot.com/forum/t-181802/basic-world-example</link>
				<description></description>
				<pubDate>Fri, 11 Sep 2009 15:27:49 +0000</pubDate>
				<wikidot:authorName>ggblake</wikidot:authorName>				<wikidot:authorUserId>375296</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I coded the example verbatum but the falling box falls through the immovable box.<br /> The only change in code was :</p> <p>in the BoxActor class</p> <p>_skin.AddPrimitive(box, new MaterialProperties(0.8f, 0.8f, 0.7f));// 2 parameters not 3</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>