Pārlūkot izejas kodu

optimisation of the "bone socket" tutorial (#3864)

Less matrix operations doing.
pull/3868/head
iP pirms 9 mēnešiem
committed by GitHub
vecāks
revīzija
1fad8277a3
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: B5690EEEBB952194
1 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  1. +2
    -4
      examples/models/models_bone_socket.c

+ 2
- 4
examples/models/models_bone_socket.c Parādīt failu

@ -144,10 +144,8 @@ int main(void)
Matrix matrixTransform = QuaternionToMatrix(rotate);
// Translate socket to its position in the current animation
matrixTransform = MatrixMultiply(matrixTransform, MatrixTranslate(transform->translation.x, transform->translation.y, transform->translation.z));
// Rotate socket by character angle
matrixTransform = MatrixMultiply(matrixTransform, QuaternionToMatrix(characterRotate));
// Translate socket to character position
matrixTransform = MatrixMultiply(matrixTransform, MatrixTranslate(position.x, position.y + 0.0f, position.z));
// Transform the socket using the transform of the character (angle and translate)
matrixTransform = MatrixMultiply(matrixTransform, characterModel.transform);
// Draw mesh at socket position with socket angle rotation
DrawMesh(equipModel[i].meshes[0], equipModel[i].materials[1], matrixTransform);

||||||
x
 
000:0
Notiek ielāde…
Atcelt
Saglabāt