I’m in search of a cleaner sample to storing character place knowledge, offsets, and transformations. I at present have a personality with a vec3 for place.
Entity{
place: vec3
rotation: vec4Quaternion
velocity: vec3
}
I take advantage of this place vector because the world coordinate. In order that when Y=zero I think about the characters toes are on the bottom. This makes it simpler to consider the place the entity is in world house.
The issue I’m having is that mesh entities like colliders or the pores and skin mesh will assume a place vector on the middle of the mesh. That is inflicting me to need to do a bunch of transformation juggling. I am unable to 1-to-1 map these meshes to the entities world place.
I’ll replace my characters ‘floor place’ after they transfer. then need to calculate the brand new ‘middle place’ which is calculated like
centerPosition = [
groundPosition.x
groundPosition.y + entityHeight/2,
groundPosition.z
]
I”m questioning if there’s a higher sample for this. Possibly I assume the entities place
vector is a ‘middle place’ as nicely? however not clear to me the best way to deal with the bottom offset in that case.