Search
 
SCRIPT & CODE EXAMPLE
 

CPP

bullet physics directx 11

// BULLET PHYSICS LIBRARY

// function to get OpenGL matrix (yeah, not there yet)
float m[16];
// basically stores the physics body's transform as matrix
physicsBody->getWorldTransform().getOpenGLMatrix(m);

// convert to direct-x matrix (column major)
XMFLOAT4X4 matrix;
matrix._11 = m[0];    matrix._12 = m[4];    matrix._13 = m[8];    matrix._14 = m[12];
matrix._21 = m[1];    matrix._22 = m[5];    matrix._23 = m[9];    matrix._24 = m[13];
matrix._31 = m[2];    matrix._32 = m[6];    matrix._33 = m[10];    matrix._34 = m[14];
matrix._41 = m[3];    matrix._42 = m[7];    matrix._43 = m[11];    matrix._44 = m[15];

// now update this matrix is the mesh's model matrix and will move with physics simulation
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to call subclass override method in c++ 
Cpp :: how to get the numbers in a vector c++ sfml 
Cpp :: powers of 2 in cpp 
Cpp :: min stack 
Cpp :: scope resolution operator in c++ 
Cpp :: operator overload 
Cpp :: c++ multi-dimensional arrays 
Cpp :: c++ array on heap 
Cpp :: Basic stack implementation in c++ 
Cpp :: how to create a structure c++ 
Cpp :: vector to char array c++ 
Cpp :: Find first and last digit of int 
Cpp :: decrement c++ 
Cpp :: string array 2d c++ 
Cpp :: english to french typing online 
C :: csrf_exempt 
C :: c distance in the cartesian plane 
C :: Sorting number excluding elements in highest to lowest 
C :: save numpy array to text file 
C :: how to prevent user from entering char when needing int in c 
C :: types of instruction and there meaning in c 
C :: postgres random select 
C :: c concatenate strings 
C :: create empty vector in rust 
C :: c check if character is a digit 
C :: insertion sort c 
C :: bitwise operators in c 
C :: c style string 
C :: #define arduino 
C :: write a c program to find size of variable 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =