Questions tagged [vector]
A mathematical concept that can be used to express position, direction or velocity and which can simplify or outright trivialise spatial problems.
741
questions
0
votes
0
answers
35
views
How detect collision between object1[i] and object2[j] then do something with them in Box2D games?
I am making a simple game with Box2D and SDL2. I have GameObjects vectors for example: 1.vector of Enemy 2.vector of Bullets…
in ContactListener class i can detect collision between enemyFixture and ...
0
votes
1
answer
68
views
Object collision and vector reflection for complex polygons?
I am currently creating an environment to train aim-bot AI's for my game. It is a 2d world made of complex polygons, and the goal is to have the AI's shoot ricocheting bullets. Using a ray-casting ...
0
votes
0
answers
76
views
Suspension vector direction of a raycast vehicle
I'm working on a raycast-based vehicle in a 3D world using a physics engine. It's basically a chassis object that contains a transform (translation, rotation, scale), a dynamic rigid body (with mass, ...
0
votes
1
answer
72
views
How to tell when calculating an Intercept Point between two moving objects, when it will never intercept?
I'm not a maths person and the formulas you see on maths type questions/answer with all the symbols is completely beyond me - I'm sorry. However I had help about 18 months ago to turn a provided ...
1
vote
1
answer
70
views
How to calculate rotation needed to cancel out perspective shift
I have a direction vector that's pointing to (0,0,1) in local object space. How can I calculate rotation needed to rotate it on Y axis so that from camera's point of view it would look as if it's ...
2
votes
0
answers
94
views
Calculate Up Vector of Object on Surface Given Points and Normals
Context
I want to find the up vector an object would have if it were leaning on a surface, given a large amount of points on that surface and their associated surface normals (i.e., an equation that ...
1
vote
2
answers
178
views
Calculate path segments size
I have a problem more closely described on a picture below.
The idea is that I have my agent in point A and I want to get to the point B. The problem is, that agents rotation towards point B is alpha ...
0
votes
0
answers
32
views
Getting 3D slide direction
I am trying to make my player slide down a curve (like a water slide) and so far I’ve managed to get the slide direction using the following code
...
0
votes
1
answer
100
views
How does vector raised to the power of another vector work?
I was watching this tutorial and at timestamp 3:03 he did this:
This blows my mind because I didn't expect that to actually work, how the heck does that work ???? For example, if I have vector (2, 3, ...
0
votes
2
answers
95
views
How to instantiate correctly a cube prefab?
In a FPS i'm trying to instantiate cube like the old good minecraft.
The problem is that the first cube i instantiate on terrain got y=0 but half of that cube is underground ...
All my cube prefab are ...
0
votes
1
answer
36
views
What is the relation between the magnitude of the cross product and dot product of two vectors?
If I have an equation:
|A×B|=A.B
What would be the angle in between A and B?
0
votes
1
answer
59
views
Getting the scalar speed from an X and Y velocity [duplicate]
Given a Vector2(x,y) that represents an object's velocity, like so:
...
0
votes
2
answers
282
views
How do I use these Unity math functions in Godot C#?
Here's a list of math functions I'm having trouble finding a direct function match for in Godot C#:
...
1
vote
1
answer
110
views
Twin-stick backwards tank movement
I'm creating a 3D twin-stick tank game in Godot with C#. I have created the tank movement and rotation, separate of its turret, and it seems to be working properly.
The issue: I want the body of the ...
0
votes
0
answers
34
views
How can i translate this code into java?
My only problem translating the code from this question/answer is the Vector2 method. In the web i could only find this replacement (Vector2f). But i can not import it : can't resolve reference. Also ...