mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Fixes several minor initialization issues that were causing problems with deletion/management of components and entities.
Also makes the ThirdPersonPlayer game object editor selectable again by removing an erroneously set field.
This commit is contained in:
parent
bbf7865a77
commit
2464b620ba
7 changed files with 46 additions and 9 deletions
|
|
@ -405,8 +405,9 @@ U32 Entity::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
|||
//mathWrite( *stream, getScale() );
|
||||
//stream->writeAffineTransform(mObjToWorld);
|
||||
//mathWrite(*stream, getPosition());
|
||||
mathWrite(*stream, mPos);
|
||||
//mathWrite(*stream, mPos);
|
||||
|
||||
stream->writeCompressedPoint(mPos);
|
||||
mathWrite(*stream, getRotation());
|
||||
|
||||
mDelta.move.pack(stream);
|
||||
|
|
@ -500,7 +501,8 @@ void Entity::unpackUpdate(NetConnection *con, BitStream *stream)
|
|||
|
||||
Point3F pos;
|
||||
|
||||
mathRead(*stream, &pos);
|
||||
stream->readCompressedPoint(&pos);
|
||||
//mathRead(*stream, &pos);
|
||||
|
||||
RotationF rot;
|
||||
|
||||
|
|
@ -893,8 +895,10 @@ void Entity::setMountRotation(EulerF rotOffset)
|
|||
void Entity::getCameraTransform(F32* pos, MatrixF* mat)
|
||||
{
|
||||
Vector<CameraInterface*> updaters = getComponents<CameraInterface>();
|
||||
for (Vector<CameraInterface*>::iterator it = updaters.begin(); it != updaters.end(); it++) {
|
||||
if ((*it)->getCameraTransform(pos, mat)) {
|
||||
for (Vector<CameraInterface*>::iterator it = updaters.begin(); it != updaters.end(); it++)
|
||||
{
|
||||
if ((*it)->getCameraTransform(pos, mat))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1210,7 +1214,7 @@ void Entity::removeObject(SimObject* object)
|
|||
|
||||
bool Entity::addComponent(Component *comp)
|
||||
{
|
||||
if (comp == NULL || !comp->isProperlyAdded())
|
||||
if (comp == NULL)
|
||||
return false;
|
||||
|
||||
//double-check were not re-adding anything
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue