Removed prim joint logic. (Dead code)
This commit is contained in:
@@ -389,7 +389,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj,
|
|||||||
// don't include an avatar.
|
// don't include an avatar.
|
||||||
LLViewerObject* root = obj;
|
LLViewerObject* root = obj;
|
||||||
|
|
||||||
while(!root->isAvatar() && root->getParent() && !root->isJointChild())
|
while(!root->isAvatar() && root->getParent())
|
||||||
{
|
{
|
||||||
LLViewerObject* parent = (LLViewerObject*)root->getParent();
|
LLViewerObject* parent = (LLViewerObject*)root->getParent();
|
||||||
if (parent->isAvatar())
|
if (parent->isAvatar())
|
||||||
@@ -704,7 +704,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s
|
|||||||
// don't include an avatar.
|
// don't include an avatar.
|
||||||
LLViewerObject* root = object;
|
LLViewerObject* root = object;
|
||||||
|
|
||||||
while(!root->isAvatar() && root->getParent() && !root->isJointChild())
|
while(!root->isAvatar() && root->getParent())
|
||||||
{
|
{
|
||||||
LLViewerObject* parent = (LLViewerObject*)root->getParent();
|
LLViewerObject* parent = (LLViewerObject*)root->getParent();
|
||||||
if (parent->isAvatar())
|
if (parent->isAvatar())
|
||||||
@@ -1419,7 +1419,7 @@ void LLSelectMgr::promoteSelectionToRoot()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LLViewerObject* parentp = object;
|
LLViewerObject* parentp = object;
|
||||||
while(parentp->getParent() && !(parentp->isRootEdit() || parentp->isJointChild()))
|
while(parentp->getParent() && !(parentp->isRootEdit()))
|
||||||
{
|
{
|
||||||
parentp = (LLViewerObject*)parentp->getParent();
|
parentp = (LLViewerObject*)parentp->getParent();
|
||||||
}
|
}
|
||||||
@@ -4468,8 +4468,7 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor
|
|||||||
virtual bool apply(LLViewerObject* object)
|
virtual bool apply(LLViewerObject* object)
|
||||||
{
|
{
|
||||||
if ( object->permModify() && // preemptive permissions check
|
if ( object->permModify() && // preemptive permissions check
|
||||||
object->isRoot() && // don't send for child objects
|
object->isRoot()) // don't send for child objects
|
||||||
!object->isJointChild())
|
|
||||||
{
|
{
|
||||||
object->setFlags( mFlags, mState);
|
object->setFlags( mFlags, mState);
|
||||||
}
|
}
|
||||||
@@ -6302,8 +6301,6 @@ void LLSelectMgr::updateSelectionCenter()
|
|||||||
// matches the root prim's (affecting the orientation of the manipulators).
|
// matches the root prim's (affecting the orientation of the manipulators).
|
||||||
bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() );
|
bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() );
|
||||||
|
|
||||||
std::vector < LLViewerObject *> jointed_objects;
|
|
||||||
|
|
||||||
for (LLObjectSelection::iterator iter = mSelectedObjects->begin();
|
for (LLObjectSelection::iterator iter = mSelectedObjects->begin();
|
||||||
iter != mSelectedObjects->end(); iter++)
|
iter != mSelectedObjects->end(); iter++)
|
||||||
{
|
{
|
||||||
@@ -6321,17 +6318,11 @@ void LLSelectMgr::updateSelectionCenter()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bbox.addBBoxAgent( object->getBoundingBoxAgent() );
|
bbox.addBBoxAgent( object->getBoundingBoxAgent() );
|
||||||
|
|
||||||
if (object->isJointChild())
|
|
||||||
{
|
|
||||||
jointed_objects.push_back(object);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVector3 bbox_center_agent = bbox.getCenterAgent();
|
LLVector3 bbox_center_agent = bbox.getCenterAgent();
|
||||||
mSelectionCenterGlobal = gAgent.getPosGlobalFromAgent(bbox_center_agent);
|
mSelectionCenterGlobal = gAgent.getPosGlobalFromAgent(bbox_center_agent);
|
||||||
mSelectionBBox = bbox;
|
mSelectionBBox = bbox;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !(gAgentID == LLUUID::null))
|
if ( !(gAgentID == LLUUID::null))
|
||||||
@@ -6625,19 +6616,19 @@ void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom)
|
|||||||
bool LLObjectSelection::is_root::operator()(LLSelectNode *node)
|
bool LLObjectSelection::is_root::operator()(LLSelectNode *node)
|
||||||
{
|
{
|
||||||
LLViewerObject* object = node->getObject();
|
LLViewerObject* object = node->getObject();
|
||||||
return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild());
|
return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLObjectSelection::is_valid_root::operator()(LLSelectNode *node)
|
bool LLObjectSelection::is_valid_root::operator()(LLSelectNode *node)
|
||||||
{
|
{
|
||||||
LLViewerObject* object = node->getObject();
|
LLViewerObject* object = node->getObject();
|
||||||
return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild());
|
return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLObjectSelection::is_root_object::operator()(LLSelectNode *node)
|
bool LLObjectSelection::is_root_object::operator()(LLSelectNode *node)
|
||||||
{
|
{
|
||||||
LLViewerObject* object = node->getObject();
|
LLViewerObject* object = node->getObject();
|
||||||
return (object != NULL) && (object->isRootEdit() || object->isJointChild());
|
return (object != NULL) && (object->isRootEdit());
|
||||||
}
|
}
|
||||||
|
|
||||||
LLObjectSelection::LLObjectSelection() :
|
LLObjectSelection::LLObjectSelection() :
|
||||||
|
|||||||
@@ -241,7 +241,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
|||||||
mNumFaces(0),
|
mNumFaces(0),
|
||||||
mTimeDilation(1.f),
|
mTimeDilation(1.f),
|
||||||
mRotTime(0.f),
|
mRotTime(0.f),
|
||||||
mJointInfo(NULL),
|
|
||||||
mState(0),
|
mState(0),
|
||||||
mMedia(NULL),
|
mMedia(NULL),
|
||||||
mClickAction(0),
|
mClickAction(0),
|
||||||
@@ -286,12 +285,6 @@ LLViewerObject::~LLViewerObject()
|
|||||||
mInventory = NULL;
|
mInventory = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mJointInfo)
|
|
||||||
{
|
|
||||||
delete mJointInfo;
|
|
||||||
mJointInfo = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mPartSourcep)
|
if (mPartSourcep)
|
||||||
{
|
{
|
||||||
mPartSourcep->setDead();
|
mPartSourcep->setDead();
|
||||||
@@ -345,9 +338,6 @@ void LLViewerObject::markDead()
|
|||||||
if (getParent())
|
if (getParent())
|
||||||
{
|
{
|
||||||
((LLViewerObject *)getParent())->removeChild(this);
|
((LLViewerObject *)getParent())->removeChild(this);
|
||||||
// go ahead and delete any jointinfo's that we find
|
|
||||||
delete mJointInfo;
|
|
||||||
mJointInfo = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark itself as dead
|
// Mark itself as dead
|
||||||
@@ -764,7 +754,7 @@ void LLViewerObject::addThisAndNonJointChildren(std::vector<LLViewerObject*>& ob
|
|||||||
iter != mChildList.end(); ++iter)
|
iter != mChildList.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLViewerObject* child = *iter;
|
LLViewerObject* child = *iter;
|
||||||
if ( (!child->isAvatar()) && (!child->isJointChild()))
|
if ( (!child->isAvatar()))
|
||||||
{
|
{
|
||||||
child->addThisAndNonJointChildren(objects);
|
child->addThisAndNonJointChildren(objects);
|
||||||
}
|
}
|
||||||
@@ -1326,27 +1316,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||||||
parameterChanged(iter->first, iter->second->data, FALSE, false);
|
parameterChanged(iter->first, iter->second->data, FALSE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U8 joint_type = 0;
|
|
||||||
mesgsys->getU8Fast(_PREHASH_ObjectData, _PREHASH_JointType, joint_type, block_num);
|
|
||||||
if (joint_type)
|
|
||||||
{
|
|
||||||
// create new joint info
|
|
||||||
if (!mJointInfo)
|
|
||||||
{
|
|
||||||
mJointInfo = new LLVOJointInfo;
|
|
||||||
}
|
|
||||||
mJointInfo->mJointType = (EHavokJointType) joint_type;
|
|
||||||
mesgsys->getVector3Fast(_PREHASH_ObjectData, _PREHASH_JointPivot, mJointInfo->mPivot, block_num);
|
|
||||||
mesgsys->getVector3Fast(_PREHASH_ObjectData, _PREHASH_JointAxisOrAnchor, mJointInfo->mAxisOrAnchor, block_num);
|
|
||||||
}
|
|
||||||
else if (mJointInfo)
|
|
||||||
{
|
|
||||||
// this joint info is no longer needed
|
|
||||||
delete mJointInfo;
|
|
||||||
mJointInfo = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2035,14 +2004,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||||||
|
|
||||||
cur_parentp->removeChild(this);
|
cur_parentp->removeChild(this);
|
||||||
|
|
||||||
if (mJointInfo && !parent_id)
|
|
||||||
{
|
|
||||||
// since this object is no longer parent-relative
|
|
||||||
// we make sure we delete any joint info
|
|
||||||
delete mJointInfo;
|
|
||||||
mJointInfo = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
setChanged(MOVED | SILHOUETTE);
|
setChanged(MOVED | SILHOUETTE);
|
||||||
|
|
||||||
if (mDrawable.notNull())
|
if (mDrawable.notNull())
|
||||||
@@ -2264,85 +2225,9 @@ BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
|||||||
F32 dt_raw = (F32)(time - mLastInterpUpdateSecs);
|
F32 dt_raw = (F32)(time - mLastInterpUpdateSecs);
|
||||||
F32 dt = mTimeDilation * dt_raw;
|
F32 dt = mTimeDilation * dt_raw;
|
||||||
|
|
||||||
if (!mJointInfo)
|
applyAngularVelocity(dt);
|
||||||
{
|
|
||||||
applyAngularVelocity(dt);
|
|
||||||
}
|
|
||||||
|
|
||||||
LLViewerObject *parentp = (LLViewerObject *) getParent();
|
if (isAttachment())
|
||||||
if (mJointInfo)
|
|
||||||
{
|
|
||||||
if (parentp)
|
|
||||||
{
|
|
||||||
// do parent-relative stuff
|
|
||||||
LLVector3 ang_vel = getAngularVelocity();
|
|
||||||
F32 omega = ang_vel.magVecSquared();
|
|
||||||
F32 angle = 0.0f;
|
|
||||||
LLQuaternion dQ;
|
|
||||||
if (omega > 0.00001f)
|
|
||||||
{
|
|
||||||
omega = sqrt(omega);
|
|
||||||
angle = omega * dt;
|
|
||||||
dQ.setQuat(angle, ang_vel);
|
|
||||||
}
|
|
||||||
LLVector3 pos = getPosition();
|
|
||||||
|
|
||||||
if (HJT_HINGE == mJointInfo->mJointType)
|
|
||||||
{
|
|
||||||
// hinge = uniform circular motion
|
|
||||||
LLVector3 parent_pivot = getVelocity();
|
|
||||||
LLVector3 parent_axis = getAcceleration();
|
|
||||||
|
|
||||||
angle = dt * (ang_vel * mJointInfo->mAxisOrAnchor); // AxisOrAnchor = axis
|
|
||||||
dQ.setQuat(angle, mJointInfo->mAxisOrAnchor); // AxisOrAnchor = axis
|
|
||||||
LLVector3 pivot_offset = pos - mJointInfo->mPivot; // pos in pivot-frame
|
|
||||||
pivot_offset = pivot_offset * dQ; // new rotated pivot-frame pos
|
|
||||||
pos = mJointInfo->mPivot + pivot_offset; // parent-frame
|
|
||||||
LLViewerObject::setPosition(pos);
|
|
||||||
LLQuaternion Q_PC = getRotation();
|
|
||||||
setRotation(Q_PC * dQ);
|
|
||||||
mLastInterpUpdateSecs = time;
|
|
||||||
}
|
|
||||||
else if (HJT_POINT == mJointInfo->mJointType)
|
|
||||||
// || HJT_LPOINT == mJointInfo->mJointType)
|
|
||||||
{
|
|
||||||
// point-to-point = spin about axis and uniform circular motion
|
|
||||||
// of axis about the pivot point
|
|
||||||
//
|
|
||||||
// NOTE: this interpolation scheme is not quite good enough to
|
|
||||||
// reduce the bandwidth -- needs a gravitational correction.
|
|
||||||
// Similarly for hinges with axes that deviate from vertical.
|
|
||||||
|
|
||||||
LLQuaternion Q_PC = getRotation();
|
|
||||||
Q_PC = Q_PC * dQ;
|
|
||||||
setRotation(Q_PC);
|
|
||||||
|
|
||||||
LLVector3 pivot_to_child = - mJointInfo->mAxisOrAnchor; // AxisOrAnchor = anchor
|
|
||||||
pos = mJointInfo->mPivot + pivot_to_child * Q_PC;
|
|
||||||
LLViewerObject::setPosition(pos);
|
|
||||||
mLastInterpUpdateSecs = time;
|
|
||||||
}
|
|
||||||
/* else if (HJT_WHEEL == mJointInfo->mJointInfo)
|
|
||||||
{
|
|
||||||
// wheel = uniform rotation about axis, with linear
|
|
||||||
// velocity interpolation (if any)
|
|
||||||
LLVector3 parent_axis = getAcceleration(); // HACK -- accel stores the parent-axis (parent-frame)
|
|
||||||
|
|
||||||
LLQuaternion Q_PC = getRotation();
|
|
||||||
|
|
||||||
angle = dt * (parent_axis * ang_vel);
|
|
||||||
dQ.setQuat(angle, parent_axis);
|
|
||||||
|
|
||||||
Q_PC = Q_PC * dQ;
|
|
||||||
setRotation(Q_PC);
|
|
||||||
|
|
||||||
pos = getPosition() + dt * getVelocity();
|
|
||||||
LLViewerObject::setPosition(pos);
|
|
||||||
mLastInterpUpdateSecs = time;
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isAttachment())
|
|
||||||
{
|
{
|
||||||
mLastInterpUpdateSecs = time;
|
mLastInterpUpdateSecs = time;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -3951,15 +3836,6 @@ void LLViewerObject::setPositionEdit(const LLVector3 &pos_edit, BOOL damped)
|
|||||||
((LLViewerObject *)getParent())->setPositionEdit(pos_edit - position_offset);
|
((LLViewerObject *)getParent())->setPositionEdit(pos_edit - position_offset);
|
||||||
updateDrawable(damped);
|
updateDrawable(damped);
|
||||||
}
|
}
|
||||||
else if (isJointChild())
|
|
||||||
{
|
|
||||||
// compute new parent-relative position
|
|
||||||
LLViewerObject *parent = (LLViewerObject *) getParent();
|
|
||||||
LLQuaternion inv_parent_rot = parent->getRotation();
|
|
||||||
inv_parent_rot.transQuat();
|
|
||||||
LLVector3 pos_parent = (pos_edit - parent->getPositionRegion()) * inv_parent_rot;
|
|
||||||
LLViewerObject::setPosition(pos_parent, damped);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLViewerObject::setPosition(pos_edit, damped);
|
LLViewerObject::setPosition(pos_edit, damped);
|
||||||
@@ -3973,8 +3849,7 @@ LLViewerObject* LLViewerObject::getRootEdit() const
|
|||||||
{
|
{
|
||||||
const LLViewerObject* root = this;
|
const LLViewerObject* root = this;
|
||||||
while (root->mParent
|
while (root->mParent
|
||||||
&& !(root->mJointInfo
|
&& !((LLViewerObject*)root->mParent)->isAvatar())
|
||||||
|| ((LLViewerObject*)root->mParent)->isAvatar()) )
|
|
||||||
{
|
{
|
||||||
root = (LLViewerObject*)root->mParent;
|
root = (LLViewerObject*)root->mParent;
|
||||||
}
|
}
|
||||||
@@ -4710,19 +4585,11 @@ void LLViewerObject::clearIcon()
|
|||||||
|
|
||||||
LLViewerObject* LLViewerObject::getSubParent()
|
LLViewerObject* LLViewerObject::getSubParent()
|
||||||
{
|
{
|
||||||
if (isJointChild())
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
return (LLViewerObject*) getParent();
|
return (LLViewerObject*) getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
const LLViewerObject* LLViewerObject::getSubParent() const
|
const LLViewerObject* LLViewerObject::getSubParent() const
|
||||||
{
|
{
|
||||||
if (isJointChild())
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
return (const LLViewerObject*) getParent();
|
return (const LLViewerObject*) getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,18 +93,6 @@ typedef void (*inventory_callback)(LLViewerObject*,
|
|||||||
S32 serial_num,
|
S32 serial_num,
|
||||||
void*);
|
void*);
|
||||||
|
|
||||||
// a small struct for keeping track of joints
|
|
||||||
struct LLVOJointInfo
|
|
||||||
{
|
|
||||||
EHavokJointType mJointType;
|
|
||||||
LLVector3 mPivot; // parent-frame
|
|
||||||
// whether the below an axis or anchor (and thus its frame)
|
|
||||||
// depends on the joint type:
|
|
||||||
// HINGE ==> axis=parent-frame
|
|
||||||
// P2P ==> anchor=child-frame
|
|
||||||
LLVector3 mAxisOrAnchor;
|
|
||||||
};
|
|
||||||
|
|
||||||
// for exporting textured materials from SL
|
// for exporting textured materials from SL
|
||||||
struct LLMaterialExportInfo
|
struct LLMaterialExportInfo
|
||||||
{
|
{
|
||||||
@@ -192,8 +180,6 @@ public:
|
|||||||
virtual void updateRadius() {};
|
virtual void updateRadius() {};
|
||||||
virtual F32 getVObjRadius() const; // default implemenation is mDrawable->getRadius()
|
virtual F32 getVObjRadius() const; // default implemenation is mDrawable->getRadius()
|
||||||
|
|
||||||
BOOL isJointChild() const { return mJointInfo ? TRUE : FALSE; }
|
|
||||||
EHavokJointType getJointType() const { return mJointInfo ? mJointInfo->mJointType : HJT_INVALID; }
|
|
||||||
// for jointed and other parent-relative hacks
|
// for jointed and other parent-relative hacks
|
||||||
LLViewerObject* getSubParent();
|
LLViewerObject* getSubParent();
|
||||||
const LLViewerObject* getSubParent() const;
|
const LLViewerObject* getSubParent() const;
|
||||||
@@ -751,7 +737,6 @@ protected:
|
|||||||
F32 mTimeDilation; // Time dilation sent with the object.
|
F32 mTimeDilation; // Time dilation sent with the object.
|
||||||
F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)
|
F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega)
|
||||||
|
|
||||||
LLVOJointInfo* mJointInfo;
|
|
||||||
U8 mState; // legacy
|
U8 mState; // legacy
|
||||||
LLViewerObjectMedia* mMedia; // NULL if no media associated
|
LLViewerObjectMedia* mMedia; // NULL if no media associated
|
||||||
U8 mClickAction;
|
U8 mClickAction;
|
||||||
|
|||||||
Reference in New Issue
Block a user