Tag Info

Hot answers tagged

3

Rotations are extremely order-dependent. Doubly so when you're composing rotations in local space (so the axes you're rotating around are themselves rotating from one frame to the next) As an extreme example, imagine that you start facing z+, and in one frame you pitch (x rotation) 90 degrees up. In the next frame, you yaw (y rotation) 90 degrees left. ...


2

This is a script that keeps the rotation of the head to the rotation you set in the script, however it is very simple and may need adjustment to your purpose.(I have included sliders for easy editing). I hope this answers your question. using UnityEngine; using System.Collections; [ExecuteInEditMode] // This allows it to run during editmode(Makes it easier ...


1

If you map the UV coordinates of a square texture to that quad it will automatically give you the effect you're looking for. In other words, map the texture the same as you would for the face of a cube; Upper-left: 0, 0 Upper-right: 1, 0 Lower-left: 0, 1 Lower-right: 1, 1 Unfortunately, doing it this way will cause perspective issues because you're ...


1

You might be able to side-step using rectangles altogether. For a top-down shooter you could use bounding circles instead of boxes. Checking collision between circles is much easier and faster than checking collision between non-axis-aligned bounding boxes (just check if the distance squared is less than the sum of the radii squared) and you don't need to ...


1

I found the culprit. glm::degrees(angle) I had copy pasted that line from some guy off the internet who was for some reason converting the angle to degrees. There is absolutely no need for this conversion. According to a user on reddit: One warning about this method, your model matrix will degrade over time using this kind of technique (repeatedly ...


1

However, this results in a funny trajectory -- imagine an erect missile tilted a little backward, and at the time of landing, the missile is tilted a little forward. The answer lies here. Physics engine actually successfully simulates the trajectory rotation of the object in relation with its rigidbodies velocity when you use LookRotation() in the ...


1

Because rotations are order-dependent, as described in my comment above, the internal state you store needs to fully-describe an orientation. In general, you can do this by storing a targetOrientation quaternion. If you're only ever doing rotations of +-90 degrees about the x/y/z axes then you can store a more reduced state (there are only 24 possible ...



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