syncTransform()
in havokPlugin.ts
syncTransform(body: PhysicsBody, transformNode: TransformNode): void {
if (body._pluginDataInstances.length) {
// HEAPU8 buffer reading and Instance matrix setting
// Why do we have this if block portion?
// ...
} else {
try {
// regular
const bodyTransform = this._hknp.HP_Body_GetQTransform(body._pluginData.hpBodyId)[1];
// ...
}
}
}
I’m trying to learn Babylon’s source for the Havok plugin. For this function, I was wondering why we don’t always use HP_Body_GetQTransform()
? I’m curious about the purpose of the portion above where we read the HEAPU8
buffer.
Thank you all for helping to learn and understand this!