Hot answers tagged

3

Get the difference between the last and the current EulerAngles variable, add it to another variable, check that variable and if the variable is over 360, subtract 360 from it and add one to the spin counter. So, something like this (might not work exactly as it's typed in, didn't test the code but it can at least be used as pseudo-code): float rollDegree =...


3

To align a javelin, you should properly compute all forces. The reason that a javelin can orient itself into its path, is because of air drag. Note that the drag is not always asymmetric enough to induce enough torque to align it: Sometimes a javelin lands with point sticking in the grass, sometimes it lands flat on the ground. Note that gravity should ...


3

Summary My recommendation is to compute a restorative torque to apply to the object. This is physically more accurate than setting the velocity directly, and the simulation will be better behaved. This solution should also work for any launch angle. Below is a gif of this method at work stabilizing arrows launched from a car. Restorative Torque This ...


2

I wouldn't recommend planning to switch engines. You should always develop in the game engine you ultimately intend to use. The only possible exception is when prototyping, and that doesn't sound like what you're asking about. That said, Hero Engine looks like a fine choice for the entire project. There is one obvious advantage to Unity: it's cross platform....


2

Have you ever thrown a javelin straight up? It does actually rotate quickly on top, because the pointy end is heavier. But it does so not when it reaches the top but after the velocity changes to move downward. It's built that way to ensure the pointy end hits the target ... You can try to model torque but that gets ugly with different weights, lengths, and ...


2

Might be advantageous to not demand a totally full circle (= airplane back completely horizontal rotation) for an "accepted roll" - maybe it's sufficient, and more user-friendly, to reach an almost horizontal position in order to consider it a completed roll? In addition, it's always a bit hairy to use an accumulation over a long period of time - it may ...


2

ForceMode is an enumeration. It has 4 values, ForceMode.Acceleration = Constant change not affected by mass ForceMode.Force = Constant change which is affected by mass ForceMode.Impulse = Instant change which is affected by mass ForceMode.VelocityChange = Instant change which is not affected by mass For more details, watch the Official Unity tutorial ...


1

The default rigidbody.AddForce applies the force facing the center of mass of your rigidbody, so it will never directly cause any rotation. But there is also the method rigidbody.AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode). This method can be used to apply forces to an object which are off-center and thus will result in a mix of ...


1

Torque is just a rotational version of the same principle as linear impulses: Let us look at F = ma To compute the change in velocity, we change it to a = F/m Likewise we can say: T = Iw Where T is torque, I is inertia, and w is angular acceleration. Let's rearrange that: w = T/I Now we can use torque to compute the change in rotation. However, ...


1

maybe you should position the javelin in such a way, that the 'nose' of the javelin is where the curve is, not in the middle, that way it might look a little 'more natural'. or you can add a turning delta that javelin can turn only by certain degrees that are given to it, that way it goes maybe a little bit out of sync but it will look better ;-)


1

One suggestion I could think of is to restructure how you think of the math, and also working from the outside in. So first, have it so that your input directly controls the wheels - not very realistic, but it will allow for you to see what happens with the physics of the wheels spinning against the ground without an excessive amount of variables ...


1

I will assume this question is about 3D SAT which I find has alot less resources than 2D.. I have been struggling with this for the past week. I have face contacts down but not Edge cases. When you are testing your various axes keep track of which has the minimum overlap, that is your contact normal and penetration depth. Contact points are where it gets ...


1

{ 0.000000, NaN, 0.000000 }. NaN smell of division by zero. check AnglularAcceleration () AnglAcc = new Vector3(0f,(speed * speed) / (2f * theta.y),0f); AnglAcc.Y will be NaN when theta.y =0


1

If you are trying to deduce difference in force and how it effects a single object with a change to its center of gravity, making each component of that object, a single object and then using its force to calculate any strain or pressure would seem to be the way to do it. If you have two weights on a bar, and they rotate around the center, and then you want ...


1

It seems to me that you haven't defined enough of what is happening in your system, to know how it should move. I.e., I think you are missing the forces involved when one of the two component objects rotates itself. In real inertial physics, nothing moves without force being applied, but it sounds like your model for the component rotation may not include ...


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