Add [BulletSim] option AvatarToAvatarCollisionsByDefault to control whether avatars collide. This is true by default.
This is implemented with a new collision type (PhantomToOthersAvatar) to potentially allow colliding and non-colliding avatars to be present in the same scene.
So there is no provision yet for giving avatars different collision types.
This commit replaces the temporary change in commit f3eaa6d8
where avatars would never collide when using BulletSim
This is equivalent to the av_av_collisions_off option in ODE.
mb-throttle-test
parent
3a296a817b
commit
124be38f74
|
@ -174,15 +174,19 @@ public sealed class BSCharacter : BSPhysObject
|
||||||
PhysScene.PE.UpdateSingleAabb(PhysScene.World, PhysBody);
|
PhysScene.PE.UpdateSingleAabb(PhysScene.World, PhysBody);
|
||||||
|
|
||||||
// Do this after the object has been added to the world
|
// Do this after the object has been added to the world
|
||||||
PhysBody.collisionType = CollisionType.Avatar;
|
if (BSParam.AvatarToAvatarCollisionsByDefault)
|
||||||
|
PhysBody.collisionType = CollisionType.Avatar;
|
||||||
|
else
|
||||||
|
PhysBody.collisionType = CollisionType.PhantomToOthersAvatar;
|
||||||
|
|
||||||
PhysBody.ApplyCollisionMask(PhysScene);
|
PhysBody.ApplyCollisionMask(PhysScene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override void RequestPhysicsterseUpdate()
|
public override void RequestPhysicsterseUpdate()
|
||||||
{
|
{
|
||||||
base.RequestPhysicsterseUpdate();
|
base.RequestPhysicsterseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// No one calls this method so I don't know what it could possibly mean
|
// No one calls this method so I don't know what it could possibly mean
|
||||||
public override bool Stopped { get { return false; } }
|
public override bool Stopped { get { return false; } }
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,7 @@ public static class BSParam
|
||||||
public static float PhysicsUnmanLoggingFrames { get; private set; }
|
public static float PhysicsUnmanLoggingFrames { get; private set; }
|
||||||
|
|
||||||
// Avatar parameters
|
// Avatar parameters
|
||||||
|
public static bool AvatarToAvatarCollisionsByDefault { get; private set; }
|
||||||
public static float AvatarFriction { get; private set; }
|
public static float AvatarFriction { get; private set; }
|
||||||
public static float AvatarStandingFriction { get; private set; }
|
public static float AvatarStandingFriction { get; private set; }
|
||||||
public static float AvatarAlwaysRunFactor { get; private set; }
|
public static float AvatarAlwaysRunFactor { get; private set; }
|
||||||
|
@ -571,6 +572,8 @@ public static class BSParam
|
||||||
new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" ,
|
new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" ,
|
||||||
0.04f ),
|
0.04f ),
|
||||||
|
|
||||||
|
new ParameterDefn<bool>("AvatarToAvatarCollisionsByDefault", "Should avatars collide with other avatars by default?",
|
||||||
|
true),
|
||||||
new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.",
|
new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.",
|
||||||
0.2f ),
|
0.2f ),
|
||||||
new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.",
|
new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.",
|
||||||
|
|
|
@ -190,6 +190,7 @@ public class BulletHMapInfo
|
||||||
public enum CollisionType
|
public enum CollisionType
|
||||||
{
|
{
|
||||||
Avatar,
|
Avatar,
|
||||||
|
PhantomToOthersAvatar, // An avatar that it phantom to other avatars but not to anything else
|
||||||
Groundplane,
|
Groundplane,
|
||||||
Terrain,
|
Terrain,
|
||||||
Static,
|
Static,
|
||||||
|
@ -231,7 +232,12 @@ public static Dictionary<CollisionType, CollisionTypeFilterGroup> CollisionTypeM
|
||||||
{ CollisionType.Avatar,
|
{ CollisionType.Avatar,
|
||||||
new CollisionTypeFilterGroup(CollisionType.Avatar,
|
new CollisionTypeFilterGroup(CollisionType.Avatar,
|
||||||
(uint)CollisionFilterGroups.BCharacterGroup,
|
(uint)CollisionFilterGroups.BCharacterGroup,
|
||||||
(uint)(CollisionFilterGroups.BAllGroup & ~CollisionFilterGroups.BCharacterGroup))
|
(uint)(CollisionFilterGroups.BAllGroup))
|
||||||
|
},
|
||||||
|
{ CollisionType.PhantomToOthersAvatar,
|
||||||
|
new CollisionTypeFilterGroup(CollisionType.PhantomToOthersAvatar,
|
||||||
|
(uint)CollisionFilterGroups.BCharacterGroup,
|
||||||
|
(uint)(CollisionFilterGroups.BAllGroup & ~CollisionFilterGroups.BCharacterGroup))
|
||||||
},
|
},
|
||||||
{ CollisionType.Groundplane,
|
{ CollisionType.Groundplane,
|
||||||
new CollisionTypeFilterGroup(CollisionType.Groundplane,
|
new CollisionTypeFilterGroup(CollisionType.Groundplane,
|
||||||
|
|
|
@ -619,6 +619,11 @@
|
||||||
; ForwardOfflineGroupMessages = true
|
; ForwardOfflineGroupMessages = true
|
||||||
|
|
||||||
|
|
||||||
|
[BulletSim]
|
||||||
|
;# {AvatarToAvatarCollisionsByDefault} {[Startup]physics:BulletSim} {Should avatars collide with each other?} {true false} true
|
||||||
|
AvatarToAvatarCollisionsByDefault = true
|
||||||
|
|
||||||
|
|
||||||
[ODEPhysicsSettings]
|
[ODEPhysicsSettings]
|
||||||
;# {mesh_sculpted_prim} {[Startup]physics:OpenDynamicsEngine} {Mesh sculpties so they collide as they look?} {true false} true
|
;# {mesh_sculpted_prim} {[Startup]physics:OpenDynamicsEngine} {Mesh sculpties so they collide as they look?} {true false} true
|
||||||
;; Do we want to mesh sculpted prim to collide like they look?
|
;; Do we want to mesh sculpted prim to collide like they look?
|
||||||
|
|
|
@ -1045,6 +1045,9 @@
|
||||||
; magnifications use lots of memory.
|
; magnifications use lots of memory.
|
||||||
TerrainMeshMagnification = 2
|
TerrainMeshMagnification = 2
|
||||||
|
|
||||||
|
; Should avatars collide with each other?
|
||||||
|
AvatarToAvatarCollisionsByDefault = true
|
||||||
|
|
||||||
; Avatar physics height adjustments.
|
; Avatar physics height adjustments.
|
||||||
; http://opensimulator.org/wiki/BulletSim#Adjusting_Avatar_Height
|
; http://opensimulator.org/wiki/BulletSim#Adjusting_Avatar_Height
|
||||||
AvatarHeightLowFudge = 0 ; Adjustment at low end of height range
|
AvatarHeightLowFudge = 0 ; Adjustment at low end of height range
|
||||||
|
|
Loading…
Reference in New Issue