Vec4

4D vector class with component-wise operations.

Vec4

Located in ursina/vec4.py

Properties

PropertyDescription
.xX component (float)
.yY component (float)
.zZ component (float)
.wW component (float)

Example

from ursina.math import Vec4

a = Vec4(1, 0, 0, 0) * 2
print(a)         # Vec4(2, 0, 0, 0)

a = Vec4(1, 0, 1, 1) * Vec4(2, 1, 2, 3)
print(a)         # Vec4(2, 0, 2, 3)

b = Vec4(1.25235, 0, 1, 0.2)
b += Vec4(0, 1, 0, 0)
print(b)         # Vec4(1.25235, 1, 1, 0.2)