PATHSHAPE This Function does a ray cast down to see if a pathshape object is below If so, it will attempt to attach to it.
| 4752 | // This Function does a ray cast down to see if a pathshape object is below |
| 4753 | // If so, it will attempt to attach to it. |
| 4754 | void Player::updateAttachment(){ |
| 4755 | Point3F rot, pos; |
| 4756 | RayInfo rInfo; |
| 4757 | MatrixF mat = getTransform(); |
| 4758 | mat.getColumn(3, &pos); |
| 4759 | if (gServerContainer.castRay(Point3F(pos.x, pos.y, pos.z + 0.1f), |
| 4760 | Point3F(pos.x, pos.y, pos.z - 1.0f ), |
| 4761 | PathShapeObjectType, &rInfo)) |
| 4762 | { |
| 4763 | if( rInfo.object->getTypeMask() & PathShapeObjectType) //Ramen |
| 4764 | { |
| 4765 | if (getParent() == NULL) |
| 4766 | { // ONLY do this if we are not parented |
| 4767 | //Con::printf("I'm on a pathshape object. Going to attempt attachment."); |
| 4768 | ShapeBase* col = static_cast<ShapeBase*>(rInfo.object); |
| 4769 | if (!isGhost()) |
| 4770 | { |
| 4771 | this->attachToParent(col); |
| 4772 | } |
| 4773 | } |
| 4774 | } |
| 4775 | else |
| 4776 | { |
| 4777 | //Con::printf("object %i",rInfo.object->getId()); |
| 4778 | } |
| 4779 | } |
| 4780 | else |
| 4781 | { |
| 4782 | if (getParent() !=NULL) |
| 4783 | { |
| 4784 | clearProcessAfter(); |
| 4785 | attachToParent(NULL); |
| 4786 | } |
| 4787 | } |
| 4788 | } |
| 4789 | // PATHSHAPE END |
| 4790 | |
| 4791 | //---------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected