Hot answers tagged

3

You would need to know the angle to the element from the spectator, so, if you have A | | \aº| |bº\ | | \| | B where the lines marked with pipes "|" are the "facing" directions, the diagonal is the "attack line", aº is the angle between B sight and A (-30deg) and bº is the angle between A sight and B (-30deg). You had to add the angles to see the ...


2

You will need a forward vector which represent the forward direction of your ship, and the velocity of your ship. // Stuff that you need (or already have) vec3 shipForwardVector; // This is according to your game infrastructure // and ship model; make it a unit vector. mat4 worldSpaceRotationMat; // assuming ship!.transform is only ...


2

To be physical, you need to calculate friction based on the magnitude of your velocity. You can simply remove the if checks when calculating friction and store a "friction constant" instead of a "friction force." You are already essentially doing this because m_fFriction is a double and not a vector, you are just thinking about it wrong. The friction ...


1

One of the two parents is rotated 90 degrees around the Y axis. I can't be sure which way, but you can "fix" this by toggling Global/Local gizmos (its one of the two buttons in the upper-left corner, just above the "scene" tab). That, or un-rotating the parent object.


1

Alternatively, you could decouple the button push and the delta move. In the key events, you can always set the button state if (key == KeyEvent.VK_LEFT) { leftPressed = true/false; // depending on press/release } ... Then later set deltas in the move method or a controls handler method (this will stop x movement if both left and right are pressed -1 ...


1

It sounds like you want to implement your own physics instead of using what's built in. Fortunately, you don't have do any kind of parabolic calculation when jumping (unless you want to project the path of the character or something like that). Instead, you let physics run its course which will naturally create parabolic shapes. Here is some example code for ...



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