diff --git a/nel/src/pacs/move_container.cpp b/nel/src/pacs/move_container.cpp index 424f7d8b9..4d093ae6a 100644 --- a/nel/src/pacs/move_container.cpp +++ b/nel/src/pacs/move_container.cpp @@ -1676,7 +1676,7 @@ void CMoveContainer::reaction (const CCollisionOTInfo& first) CVectorD first_pos = dynInfo->getFirstPrimitive()->getFinalPosition(dynInfo->getFirstWorldImage()); CVectorD second_pos = dynInfo->getSecondPrimitive()->getFinalPosition(dynInfo->getSecondWorldImage()); nlinfo("P = %f, C = %f, H = %f, D = %f", first_pos.z, second_pos.z, dynInfo->getSecondPrimitive()->getHeight(), second_pos.z-first_pos.z); - dynInfo->getFirstPrimitive()->setZOffset(second_pos.z+dynInfo->getSecondPrimitive()->getHeight()-1.0f); + dynInfo->getFirstPrimitive()->setZOffset(second_pos.z+dynInfo->getSecondPrimitive()->getHeight()-10.0f); } } if (dynInfo->isExit()) diff --git a/ryzom/client/src/character_cl.cpp b/ryzom/client/src/character_cl.cpp index 68f8acfcb..47b1ad4a2 100644 --- a/ryzom/client/src/character_cl.cpp +++ b/ryzom/client/src/character_cl.cpp @@ -426,7 +426,7 @@ void CCharacterCL::computePrimitive() // Initialize the primitive. if (_Sheet) { - initPrimitive(_Sheet->ColRadius*getScale(), _Sheet->ColHeight*getScale(), _Sheet->ColLength, _Sheet->ColWidth, UMovePrimitive::DoNothing, UMovePrimitive::NotATrigger, MaskColNpc, MaskColNone, _Sheet->ClipRadius, _Sheet->ClipHeight); + initPrimitive(_Sheet->ColRadius*getScale(), _Sheet->ColHeight*getScale(), _Sheet->ColLength, _Sheet->ColWidth, UMovePrimitive::DoNothing, (UMovePrimitive::TTrigger)(UMovePrimitive::OverlapTrigger | UMovePrimitive::EnterTrigger), MaskColNpc, MaskColDoor, _Sheet->ClipRadius, _Sheet->ClipHeight); } else { @@ -976,7 +976,7 @@ bool CCharacterCL::build(const CEntitySheet *sheet) // virtual _CustomScalePos *= getScale(); // Create PACS Primitive. - initPrimitive(_Sheet->ColRadius*getScale(), _Sheet->ColHeight*getScale(), _Sheet->ColLength, _Sheet->ColWidth, UMovePrimitive::DoNothing, UMovePrimitive::NotATrigger, MaskColNpc, MaskColNone, _Sheet->ClipRadius, _Sheet->ClipHeight); + initPrimitive(_Sheet->ColRadius*getScale(), _Sheet->ColHeight*getScale(), _Sheet->ColLength, _Sheet->ColWidth, UMovePrimitive::DoNothing, (UMovePrimitive::TTrigger)(UMovePrimitive::OverlapTrigger | UMovePrimitive::EnterTrigger), MaskColNpc, MaskColDoor, _Sheet->ClipRadius, _Sheet->ClipHeight); // Compute the element to be able to snap the entity to the ground. computeCollisionEntity(); @@ -6678,7 +6678,7 @@ ADD_METHOD(void CCharacterCL::updatePos(const TTime ¤tTimeInMs, CEntityCL updatePosCombatFloat(frameTimeRemaining, target); } // Compute the average speed to the destination. - // double spd = + // double spd = computeSpeed(); @@ -8232,14 +8232,14 @@ float CCharacterCL::getSheetScale() const // virtual // getColRadius : // Return the entity collision radius. (return 0.5 if there is any problem). //--------------------------------------------------- -float CCharacterCL::getSheetColRadius() const +float CCharacterCL::getSheetColRadius() const { - if(!_Sheet) + if(!_Sheet) return 0.5f; else return _Sheet->ColRadius; } - + //--------------------------------------------------- // getScale : @@ -8358,7 +8358,7 @@ std::string CCharacterCL::shapeFromItem(const CItemSheet &itemSheet) const sheet = itemSheet.getShape(); return sheet; - + }// shapeFromItem // @@ -9146,7 +9146,7 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet) bi.DelayBeforeStart = 11.5f; _AttachedFXListToStart.push_front(bi); } - else + else { CAttachedFX::TSmartPtr fx = new CAttachedFX; fx->create(*this, bi, CAttachedFX::CTargeterInfo()); diff --git a/ryzom/client/src/entities.cpp b/ryzom/client/src/entities.cpp index a17a49e4f..3a13e0f30 100644 --- a/ryzom/client/src/entities.cpp +++ b/ryzom/client/src/entities.cpp @@ -945,6 +945,8 @@ bool CEntityManager::setupInstance(uint32 idx, const vector &keys, const float height = primitive->getHeight(); CVector size = CVector(width, depth, height); + if (primitive->getTriggerType() == UMovePrimitive::OverlapStairsTrigger) + size.z -= 10.0f; float v; if (getRelativeFloatFromString(values[i], v)) { @@ -954,6 +956,8 @@ bool CEntityManager::setupInstance(uint32 idx, const vector &keys, const { updateVector(param, size, v, false); } + if (primitive->getTriggerType() == UMovePrimitive::OverlapStairsTrigger) + size.z += 10.0f; primitive->setSize(size.x, size.y); primitive->setHeight(size.z); } @@ -1028,12 +1032,12 @@ bool CEntityManager::setupInstance(uint32 idx, const vector &keys, const { bool active; fromString(values[i], active); - primitive->setObstacle(active); + primitive->setObstacle(!active); if (active) { primitive->setReactionType(UMovePrimitive::DoNothing); primitive->setTriggerType(UMovePrimitive::OverlapStairsTrigger); - primitive->setGlobalPosition(instance.getPos()+CVector(0, 0, 0.5f), dynamicWI); + primitive->setGlobalPosition(instance.getPos(), dynamicWI); } else { diff --git a/ryzom/client/src/main_loop.cpp b/ryzom/client/src/main_loop.cpp index bb9a29d4d..7ce8b79fe 100644 --- a/ryzom/client/src/main_loop.cpp +++ b/ryzom/client/src/main_loop.cpp @@ -3080,9 +3080,9 @@ void displayPACSPrimitive() // Static collision if (prim->getTriggerType() == UMovePrimitive::OverlapStairsTrigger) { - line.Color0 = CRGBA::Blue; + line.Color0 = CRGBA::Green; isStairs = true; - position.z -= 1.0f; + position.z -= 10.0f; } else if (prim->getReactionType() == UMovePrimitive::DoNothing) {