Browse Source

More adjustments

Remove unneeded "safety" measures and set dynamic_blocker default value to True instead of False
pull/321/head
Patrick Dulebohn 3 years ago
parent
commit
5b49049194
  1. 41
      korman/exporter/physics.py
  2. 2
      korman/properties/modifiers/physics.py
  3. 1
      korman/ui/modifiers/physics.py

41
korman/exporter/physics.py

@ -165,28 +165,27 @@ class PhysicsConverter:
physical.friction = mod.friction physical.friction = mod.friction
physical.restitution = mod.restitution physical.restitution = mod.restitution
if not mod.dynamic_blocker: if mod.dynamic:
if mod.dynamic: if ver <= pvPots:
if ver <= pvPots: physical.collideGroup = (1 << plSimDefs.kGroupDynamic) | \
physical.collideGroup = (1 << plSimDefs.kGroupDynamic) | \ (1 << plSimDefs.kGroupStatic)
(1 << plSimDefs.kGroupStatic) physical.memberGroup = plSimDefs.kGroupDynamic
physical.memberGroup = plSimDefs.kGroupDynamic physical.mass = mod.mass
physical.mass = mod.mass _set_phys_prop(plSimulationInterface.kStartInactive, simIface, physical,
_set_phys_prop(plSimulationInterface.kStartInactive, simIface, physical, value=mod.start_asleep)
value=mod.start_asleep) elif mod.dynamic_blocker and not mod.avatar_blocker:
elif not mod.avatar_blocker:
physical.memberGroup = plSimDefs.kGroupLOSOnly
else:
physical.memberGroup = plSimDefs.kGroupStatic
# Line of Sight DB
if mod.camera_blocker:
physical.LOSDBs |= plSimDefs.kLOSDBCameraBlockers
_set_phys_prop(plSimulationInterface.kCameraAvoidObject, simIface, physical)
if mod.terrain:
physical.LOSDBs |= plSimDefs.kLOSDBAvatarWalkable
else:
physical.memberGroup = plSimDefs.kDynamicBlocker physical.memberGroup = plSimDefs.kDynamicBlocker
elif not mod.avatar_blocker and not mod.dynamic_blocker:
physical.memberGroup = plSimDefs.kGroupLOSOnly
else:
physical.memberGroup = plSimDefs.kGroupStatic
# Line of Sight DB
if mod.camera_blocker:
physical.LOSDBs |= plSimDefs.kLOSDBCameraBlockers
_set_phys_prop(plSimulationInterface.kCameraAvoidObject, simIface, physical)
if mod.terrain:
physical.LOSDBs |= plSimDefs.kLOSDBAvatarWalkable
# Hacky? We'd like to share the simple surface descriptors(TM) as much as possible... # Hacky? We'd like to share the simple surface descriptors(TM) as much as possible...
# This could result in a few orphaned PhysicalSndGroups, but I think that's preferable # This could result in a few orphaned PhysicalSndGroups, but I think that's preferable

2
korman/properties/modifiers/physics.py

@ -82,7 +82,7 @@ class PlasmaCollider(PlasmaModifierProperties):
default=True) default=True)
dynamic_blocker = BoolProperty(name="Blocks Dynamics", dynamic_blocker = BoolProperty(name="Blocks Dynamics",
description="Object blocks dynamic objects (kickables)", description="Object blocks dynamic objects (kickables)",
default=False) default=True)
friction = FloatProperty(name="Friction", friction = FloatProperty(name="Friction",
min=0.0, min=0.0,

1
korman/ui/modifiers/physics.py

@ -21,7 +21,6 @@ def collision(modifier, layout, context):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.prop(modifier, "dynamic_blocker") col.prop(modifier, "dynamic_blocker")
col.active != modifier.dynamic_blocker)
col.prop(modifier, "avatar_blocker") col.prop(modifier, "avatar_blocker")
col.prop(modifier, "camera_blocker") col.prop(modifier, "camera_blocker")
col.prop(modifier, "terrain") col.prop(modifier, "terrain")

Loading…
Cancel
Save