Mario Kart 64
Loading...
Searching...
No Matches
EditorMath.h File Reference
#include <libultraship/libultraship.h>
#include <libultra/gbi.h>
#include <libultra/types.h>
#include "../CoreMath.h"
#include <vector>
#include "GameObject.h"
#include <graphic/Fast3D/Fast3dWindow.h>
#include <graphic/Fast3D/interpreter.h>
#include "common_structs.h"
Include dependency graph for EditorMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ray
 
struct  Triangle
 

Functions

bool IsInGameScreen ()
 
FVector ScreenRayTrace ()
 
bool QueryCollisionRayActor (Vec3f rayOrigin, Vec3f rayDir, Vec3f actorMin, Vec3f actorMax, float *t)
 
FVector4 MultiplyMatrixVector (float matrix[4][4], float vector[4])
 
static bool InverseMatrix (const float m[16], float invOut[16])
 
void Copy (MtxF *src, MtxF *dest)
 
void Clear (MtxF *mf)
 
FVector TransformVecByMatrix (const FVector &vec, const float mtx[4][4])
 
FVector TransformVecDirection (const FVector &dir, const float mtx[4][4])
 
Ray RayToLocalSpace (MtxF mtx, const Ray &ray)
 
bool IntersectRayTriangle (const Ray &ray, const Triangle &tri, float &t)
 
bool IntersectRayTriangleAndTransform (const Ray &ray, FVector pos, const Triangle &tri, float &t)
 
bool IntersectRaySphere (const Ray &ray, const FVector &sphereCenter, float radius, float &t)
 
std::optional< FVectorQueryHandleIntersection (MtxF mtx, Ray ray, const Triangle &tri)
 
void Editor_MatrixIdentity (Mat4 mtx)
 
void Editor_AddMatrix (Mat4 mtx, int32_t flags)
 
float CalculateAngle (const FVector &start, const FVector &end)
 
void SetDirectionFromRotator (IRotator rot, s8 direction[3])
 
void SetRotatorFromDirection (FVector direction, IRotator *rot)
 
FVector GetPositionAheadOfCamera (f32 dist)
 

Variables

std::vector< Mtx > EditorMatrix
 

Function Documentation

◆ CalculateAngle()

float CalculateAngle ( const FVector & start,
const FVector & end )

◆ Clear()

void Clear ( MtxF * mf)

◆ Copy()

void Copy ( MtxF * src,
MtxF * dest )

◆ Editor_AddMatrix()

void Editor_AddMatrix ( Mat4 mtx,
int32_t flags )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Editor_MatrixIdentity()

void Editor_MatrixIdentity ( Mat4 mtx)
Here is the caller graph for this function:

◆ GetPositionAheadOfCamera()

FVector GetPositionAheadOfCamera ( f32 dist)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IntersectRaySphere()

bool IntersectRaySphere ( const Ray & ray,
const FVector & sphereCenter,
float radius,
float & t )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IntersectRayTriangle()

bool IntersectRayTriangle ( const Ray & ray,
const Triangle & tri,
float & t )
Here is the caller graph for this function:

◆ IntersectRayTriangleAndTransform()

bool IntersectRayTriangleAndTransform ( const Ray & ray,
FVector pos,
const Triangle & tri,
float & t )
Here is the caller graph for this function:

◆ InverseMatrix()

static bool InverseMatrix ( const float m[16],
float invOut[16] )
static

◆ IsInGameScreen()

bool IsInGameScreen ( )

Projects 2D cursor into the game world

Returns
FVector ray direction

ray.x = camera->pos[0] + direction.x * length; ray.y = camera->pos[1] + direction.y * length; ray.z = camera->pos[2] + direction.z * length;

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MultiplyMatrixVector()

FVector4 MultiplyMatrixVector ( float matrix[4][4],
float vector[4] )
Here is the caller graph for this function:

◆ QueryCollisionRayActor()

bool QueryCollisionRayActor ( Vec3f rayOrigin,
Vec3f rayDir,
Vec3f actorMin,
Vec3f actorMax,
float * t )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ QueryHandleIntersection()

std::optional< FVector > QueryHandleIntersection ( MtxF mtx,
Ray ray,
const Triangle & tri )

optional used here so we can check for successful query and return the click position

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RayToLocalSpace()

Ray RayToLocalSpace ( MtxF mtx,
const Ray & ray )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScreenRayTrace()

FVector ScreenRayTrace ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDirectionFromRotator()

void SetDirectionFromRotator ( IRotator rot,
s8 direction[3] )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRotatorFromDirection()

void SetRotatorFromDirection ( FVector direction,
IRotator * rot )
Here is the caller graph for this function:

◆ TransformVecByMatrix()

FVector TransformVecByMatrix ( const FVector & vec,
const float mtx[4][4] )
Here is the caller graph for this function:

◆ TransformVecDirection()

FVector TransformVecDirection ( const FVector & dir,
const float mtx[4][4] )
Here is the caller graph for this function:

Variable Documentation

◆ EditorMatrix

std::vector<Mtx> EditorMatrix
extern