Tag Info

Hot answers tagged

3

From the docs on transform.Translate: public void Translate(float x, float y, float z, Space relativeTo = Space.Self); If relativeTo is left out or set to Space.Self the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) So because you have not specified a ...


3

Whatever collision be, angular momentum is conserved. ie Iw = constant with the coefficient of restitution (in translation, i dont know if its said the same in rotation) u define, and with the moment of inertia, you should be able to figure it out. And i think this would similar to collisions in 1D, since only one axis is used :) Goodluck :)


2

There are a couple ways. This way shows how you can do it at runtime by grabbing out all the vertices to build the BoundingBox around the model. The first answer on this page is super old but the basic idea applies to use a custom processor for your model in the content pipeline so you can compute the BoundingBox and store it in the Tag property of the ...


2

You're in luck. I did a full translation of Randy Gaul's 2D physics engine into C# and XNA. He hasn't really explained things well for beginners like me. For your answer, you should just multiply the cross product with the inverse of the inertia of the body. This is from my translation: angularVelocity += inverseInertia * Vector2D.Cross(contactVector, ...


2

Your problem is transform.up = TowardOrigin;. I didn't know you could actually set transform.up until now, since it's actually a summary of a more complex state of the object -- its rotation. Setting it tells Unity to orient your object along that axis, but doesn't tell Unity to keep transform.forward as close as possible to what it used to be. You're ...


1

//Everything normalized shipRight = shipForward.Cross(target.Up); shipUp = shipForward.Cross(shipRight); The cross-product is perpendicular to both vectors. For this diagram, I gave both spheres random orientations. The left view shows the steps from an arbitrary, third, perspective; I couldn't find a better alignment, so you'll have to take my word that ...


1

I haven't digested all of your code. Consider the effect of using the center of the rear axle as the vehicle's origin and have that point ride the actual Bezier. As such, the car's forward direction is coincident with the tangent. Both of these relate to the path of a real car. The front wheels just need to always point directly toward their ...


1

The camera up-vector A property of the camera you could use to solve this problem is the up-vector. This vector indicates which direction in 3D space should correspond with the (upward) vertical axis of your screen. Usually, cameras will use the positive y-axis for this, thus: (0, 1, 0). The scalar product of two vectors The scalar product of two 3D ...



Only top voted, non community-wiki answers of a minimum length are eligible