New answers tagged mathematics
1
vote
How to compute XP thresholds when scaling changes for each level range?
You are overcomplicating it. Doing the math once and storing it in a dictionary or list is perfectly fine. The time and memory footprint for the calculation (or read it from a config/ database) is so ...
0
votes
Simulate Velocity For A Projectile Moving Along A Spline
I think when a projectile is thrown it should have a burst of speed at the start and begin to rise slower as it reaches its peak height. Then as it starts to fall it should gradually begin to fall ...
-2
votes
Simulate Velocity For A Projectile Moving Along A Spline
Remove the spline and split speed into 2 components X,Y ie Vector2.
Fix a horizontal velocity.X from the spline.
Apply a negative rather large value to velocity.Y, and each step adjusted for delta ...
0
votes
How to tell whether an expression is independent from frame rate?
Your conclusion assumes a fixed delta-time:
u^deltatime
Which is an invalid statement if delta-time varies across steps. Almost a given on modern systems.
There ...
0
votes
Accepted
Inconsistent Speed Of A Projectile Traveling On A Bezier Curve
Well, unfortunately I wasn't able to figure this out. But I didn't want to abandon this thread without closing the loop.
If you are on Unity 2022 LTS you can simply use the Unity Spline package. It ...
4
votes
Accepted
How to properly split damage against armor?
If I've understood correctly, I'd do this as a two step process...
Calculate how much the armor absorbs, then apply the rest to the player.
Something like:
...
1
vote
Calculating average ttk given accuracy and healing
Partial answer: no healing
In your case the healing is the culprit, which makes the whole thing extremly hard to calculate. I hope my equation for the special case of h = 0 (no healing) helps you ...
0
votes
A good genetic system?
To "see the parents" in their young ones you could implement following system:
each stat has a 33.3% chance to be inherited from the father, 33.3% chance to be inherited from the mother and ...
3
votes
Calculating average ttk given accuracy and healing
If an approximation is sufficient then on average the target will take p*d damage per second and heal for h, so their net life loss will be p*d-h per second. Assuming p*d-h > 0, the time to kill is ...
1
vote
Accepted
How to tell whether an expression is independent from frame rate?
One way we can formalize this is to say we have a function \$f\$ that takes some input game state \$ {\bf x}_0 \$ and a timestep \$ \Delta t\$ and transforms it into the resulting game state \$ {\bf x}...
1
vote
How to tell whether an expression is independent from frame rate?
I am wondering if there is a general approach to determining whether
the expression that updates the value is "pinned" to real time,
meaning that running one frame with delta time x is ...
Community wiki
1
vote
How to tell whether an expression is independent from frame rate?
You are asking the difference between a mathematical derivative and a discrete derivative:
Given an expression S(delta_time) which calculates how much to increase a value by each frame, an increase ...
0
votes
How to move in 3D space in first person mode?
Camera has it's own set of axes. You generally store any two of the three : camFront, camRight and ...
0
votes
Test if a point is inside a 3D cuboid, given the 8 corner positions, through code
If you can guarantee that the 8 points form a prism with pairs of opposite faces parallel (even if the corners aren't perpendicular), then we can simplify this significantly.
We'll construct a ...
1
vote
Accepted
Euler Angle X is wrong after using Quaternion.LookRotation
If you want to enforce angular limits, keep it in terms of angles from the start. Don't count on an automatic conversion from quaternions to Euler angles to give you angles in a specific range, ...
0
votes
Euler Angle X is wrong after using Quaternion.LookRotation
If you want to isolate the heading of a look direction then zero out the up and use the atan2 function directly.
...
Top 50 recent answers are included
Related Tags
mathematics × 1970unity × 234
physics × 207
vector × 196
3d × 177
c# × 165
2d × 147
rotation × 143
opengl × 134
matrix × 132
algorithm × 128
geometry × 127
c++ × 114
collision-detection × 94
java × 86
linear-algebra × 78
javascript × 75
camera × 70
quaternion × 68
game-design × 67
transformation × 64
xna × 60
movement × 56
trigonometry × 54
projection × 49