Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!

# Untitled

By: a guest on Apr 21st, 2012  |  syntax: None  |  size: 1.86 KB  |  views: 102  |  expires: Never
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
1. void ConvertPosToBull(const Vector& pos, btVector3& bull) {
2.         bull.setX(HL2BULL(pos.x));
3.         bull.setY(HL2BULL(pos.z));
4.         bull.setZ(-HL2BULL(pos.y));
5. }
6.
7. void ConvertPosToHL(const btVector3& pos, Vector& hl) {
8.         hl.x = BULL2HL(pos.x());
9.         hl.y = -BULL2HL(pos.z());
10.         hl.z = BULL2HL(pos.y());
11. }
12.
13. void ConvertDirectionToBull(const Vector& dir, btVector3& bull) {
14.         bull.setX(dir.x);
15.         bull.setY(dir.z);
16.         bull.setZ(-dir.y);
17. }
18.
19. void ConvertDirectionToHL(const btVector3& dir, Vector& hl) {
20.         hl.x = dir.x();
21.         hl.y = -dir.z();
22.         hl.z = dir.y();
23. }
24.
25. void ConvertRotationToBull(const QAngle& angles, btMatrix3x3& bull) {
27.         btQuaternion q1;
29.         btQuaternion q2(q1.getX(), q1.getZ(), -q1.getY(), q1.getW());
30.         bull.setRotation(q2);
31. }
32.
33. void ConvertRotationToBull(const QAngle& angles, btQuaternion& bull) {
35.         btQuaternion q;
37.         bull.setX(q.getX());
38.         bull.setY(q.getZ());
39.         bull.setZ(-q.getY());
40.         bull.setW(q.getW());
41. }
42.
43. void ConvertRotationToHL(const btMatrix3x3& matrix, QAngle& hl) {
44.         btQuaternion quat;
45.         matrix.getRotation(quat);
46.         Quaternion q(quat.getX(), -quat.getZ(), quat.getY(), quat.getW());
49. }
50.
51. void ConvertRotationToHL(const btQuaternion& quat, QAngle& hl)
52. {
53.         Quaternion q(quat.getX(), -quat.getZ(), quat.getY(), quat.getW());
56. }
57.
58.
59. void ConvertAngularImpulseToBull(const AngularImpulse& angularimp, btVector3& bull) {