new layers (#483)
This commit is contained in:
@@ -111,7 +111,7 @@ namespace Content.Server.AI
|
||||
|
||||
// build the ray
|
||||
var dir = entity.GetComponent<ITransformComponent>().WorldPosition - myTransform.WorldPosition;
|
||||
var ray = new Ray(myTransform.WorldPosition, dir.Normalized, (int)(CollisionGroup.Mob | CollisionGroup.Grid));
|
||||
var ray = new Ray(myTransform.WorldPosition, dir.Normalized, (int)(CollisionGroup.MobImpassable | CollisionGroup.Impassable));
|
||||
|
||||
// cast the ray
|
||||
var result = _physMan.IntersectRay(ray, maxRayLen);
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Content.Server.AI
|
||||
for (var i = 0; i < 3; i++) // you get 3 chances to find a place to walk
|
||||
{
|
||||
var dir = new Vector2(Random01(ref rngState) * 2 - 1, Random01(ref rngState) *2 -1);
|
||||
var ray = new Ray(entWorldPos, dir, (int) CollisionGroup.Grid);
|
||||
var ray = new Ray(entWorldPos, dir, (int) CollisionGroup.Impassable);
|
||||
var rayResult = _physMan.IntersectRay(ray, MaxWalkDistance, SelfEntity);
|
||||
|
||||
if (rayResult.DidHitObject && rayResult.Distance > 1) // hit an impassable object
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Content.Server.GameObjects.Components
|
||||
// This would allow ricochets off walls, and weird gravity effects from slowing the object.
|
||||
if (collidedwith.Count > 0 && Owner.TryGetComponent(out CollidableComponent body) && body.PhysicsShapes.Count >= 1)
|
||||
{
|
||||
body.PhysicsShapes[0].CollisionMask &= (int)~CollisionGroup.Mob;
|
||||
body.PhysicsShapes[0].CollisionMask &= (int)~CollisionGroup.MobImpassable;
|
||||
body.IsScrapingFloor = true;
|
||||
|
||||
// KYS, your job is finished. Trigger ILand as well.
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
|
||||
var userPosition = user.Transform.WorldPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var angle = new Angle(clickLocation.Position - userPosition);
|
||||
|
||||
var ray = new Ray(userPosition, angle.ToVec(), (int)(CollisionGroup.Grid | CollisionGroup.Mob));
|
||||
var ray = new Ray(userPosition, angle.ToVec(), (int)(CollisionGroup.Impassable | CollisionGroup.MobImpassable));
|
||||
var rayCastResults = IoCManager.Resolve<IPhysicsManager>().IntersectRay(ray, MaxLength,
|
||||
Owner.Transform.GetMapTransform().Owner);
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
if(colComp.PhysicsShapes.Count == 0)
|
||||
colComp.PhysicsShapes.Add(new PhysShapeAabb());
|
||||
|
||||
colComp.PhysicsShapes[0].CollisionMask |= (int)CollisionGroup.Mob;
|
||||
colComp.PhysicsShapes[0].CollisionMask |= (int)CollisionGroup.MobImpassable;
|
||||
colComp.IsScrapingFloor = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user