Arithmetic, geometry, calculus, and all else which resolves the number-crunching necessary in a game. Math questions are those that deal with the formulae and calculations used by the game in various parts.

learn more… | top users | synonyms

-1
votes
0answers
18 views

How to create an invisible rectangle around a circle? [on hold]

The reason why I'm asking is so it's easier to create Grid based collision detection. So how do I create an invisible bounding box around a circle/polygon?
-1
votes
0answers
29 views

Comparing lerping quaternion

2d top down game. I want my transform to first rotate and face the target position and then move towards it. I got the rotation towards the target position done. It works great. But i need a way to ...
-1
votes
1answer
24 views

lerp z rotation towards mousepointer

I am trying to get transform.rotation.z to chase the mouse pointer at a rotation speed. But I get a very weird results and can't figure out what I am doing wrong. var mp = Input.mousePosition; ...
-1
votes
1answer
32 views

Lerp speed or lerp time [on hold]

Am I right about the fact that lerping can be done over a set period of time or at a speed which will continue until the target is reached? How are the formulas for the two? Is it something like ...
0
votes
0answers
38 views

How to convert bones skeleton into joints skeleton?

I'm exploring skeletal animation and taking Half-Life SMD format as example. It has skeleton rigged as hierarchy of joints. Each joint has a parent and offset + rotation to it. Now I'm importing ...
7
votes
3answers
330 views

Can I jump from A to B?

I'm making some rudimentary AI for my side-scroller and I need to know whether an AI unit can reach point B from point A simply by taking a jump. Flight trajectory of my characters is a bit unusal as ...
0
votes
0answers
24 views

Implementing ClearPath (crowd pathfinding)

This is the academic article: http://gamma.cs.unc.edu/CA/ClearPath.pdf Here is the confusing part (marked in red): The first part is the path in which the object will move. The first part of ...
1
vote
1answer
68 views

Area of surface contained in pixel

Let's say I have some surface rasterized and stored to a texture. How do I calculate the actual surface area that is visible in one of the rasterized pixels, from some other location? So far, I'm ...
1
vote
0answers
26 views

Calculating Friction due to rotation from ball bounce? [duplicate]

In this question asked by codemonkey, The rotation will depend upon: upon impact, on: Initial Speed of the ball hitting the surface (magnitude of ball velocity vector) Friction co-efficient of ball ...
7
votes
1answer
244 views

RK4, Derivatives, Understanding Game Physics

Gafferon Games has a great article on RK4 Integration for building physics simulations which can be found here: Integration Basics Personally my mathematics and physics knowledge could use ...
-2
votes
2answers
56 views

Convert atan2 value to standard 360-degree-system value [duplicate]

Lets say I'm using atan2 to get the angle between two vectors. atan2 gives a value in radians. I convert it to degrees using a built in function in Java. This gives me a value between 0 and 180 ...
-2
votes
1answer
54 views

How does atan2 work when getting angle of a vector?

I know that atan2 gives me the absolute angle of any vector. But it doesn't give a value from 0 to 360 degrees. Instead, it gives a value (if I'm not mistaken), between 0 and 180, or between 0 and ...
1
vote
1answer
55 views

How to adjust a font to fit inside a speech bubble?

I'm creating a game that contains a speech bubble for dialog. The idea of this function is to allow one call to set new text in a speech bubble. The speech bubble will adjust in size of the new font ...
-1
votes
0answers
37 views

Getting the angle between two vectors [duplicate]

Please see the following drawing: I need to calculate the angle between the blue vector and the red vector. The angle between the red vector and the x axis is: 30 degrees. Lets call it alpha. The ...
0
votes
1answer
59 views

Using atan2 to calculate angle between two vectors

I understand that: atan2(vector.y, vector.x) = the angle between the vector and the X axis. But I wanted to know how to get the angle between two vectors using atan2. So I came across this solution: ...

15 30 50 per page