diff options
Diffstat (limited to 'redist/linmath.c')
-rw-r--r-- | redist/linmath.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/redist/linmath.c b/redist/linmath.c index 1d70ee1..4240ed6 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -490,6 +490,8 @@ void quatrotatevector( FLT * vec3out, const FLT * quat, const FLT * vec3in ) vquat[2] = vec3in[1]; vquat[3] = vec3in[2]; + //XXX WARNING: This code is probably SLOW. See this: https://github.com/axlecrusher/hgengine3/blob/master/Mercury3/basic_light1_v.glsl + quatrotateabout( tquat, quat, vquat ); quatgetconjugate( qrecp, quat ); quatrotateabout( vquat, tquat, qrecp ); @@ -637,3 +639,11 @@ void matrix44transpose(FLT * mout, const FLT * minm ) } +void ApplyPoseToPoint( FLT * pout, const FLT * pin, const FLT * pose ) +{ + FLT v3o[3]; + quatrotatevector( v3o, &pose[3], pin ); + for(int i = 0; i < 3; i++) + pout[i] = pose[i] + v3o[i]; +} + |