MCPcopy
hub / github.com/g3n/engine / ApplyMatrix4

Method ApplyMatrix4

math32/ray.go:492–499  ·  view source on GitHub ↗

ApplyMatrix4 multiplies this ray origin and direction by the specified matrix4, basically transforming this ray coordinates.

(matrix4 *Matrix4)

Source from the content-addressed store, hash-verified

490// ApplyMatrix4 multiplies this ray origin and direction
491// by the specified matrix4, basically transforming this ray coordinates.
492func (ray *Ray) ApplyMatrix4(matrix4 *Matrix4) *Ray {
493
494 ray.direction.Add(&ray.origin).ApplyMatrix4(matrix4)
495 ray.origin.ApplyMatrix4(matrix4)
496 ray.direction.Sub(&ray.origin)
497 ray.direction.Normalize()
498 return ray
499}
500
501// Equals returns if this ray is equal to other
502func (ray *Ray) Equals(other *Ray) bool {

Callers 8

classifyAndCullMethod · 0.45
zSortFunction · 0.45
ApplyMatrixMethod · 0.45
BoundingBoxMethod · 0.45
RaycastSpriteMethod · 0.45
RaycastPointsMethod · 0.45
RaycastMeshMethod · 0.45
lineRaycastFunction · 0.45

Calls 3

AddMethod · 0.45
SubMethod · 0.45
NormalizeMethod · 0.45

Tested by

no test coverage detected