Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -24,9 +24,12 @@ function AssetObject({ definition }: { readonly definition: DungeonWorldObjectDe
|
||||
|
||||
function ProceduralObject({ definition }: { readonly definition: DungeonWorldObjectDefinition }) {
|
||||
const [x, y, z] = definition.halfExtents;
|
||||
const round = definition.kind === "trap" || definition.kind === "ritual" || definition.kind === "trigger";
|
||||
return (
|
||||
<mesh castShadow receiveShadow>
|
||||
<boxGeometry args={[x * 2, y * 2, z * 2]} />
|
||||
{round
|
||||
? <cylinderGeometry args={[Math.max(x, z), Math.max(x, z), y * 2, 16]} />
|
||||
: <boxGeometry args={[x * 2, y * 2, z * 2]} />}
|
||||
<meshStandardMaterial
|
||||
color={definition.visual?.color ?? (definition.kind === "switch" ? "#dca24a" : "#65584b")}
|
||||
emissive={definition.visual?.emissive ?? "#000000"}
|
||||
@@ -45,6 +48,8 @@ function WorldObject({
|
||||
}) {
|
||||
const state = dungeonWorldObjectState(definition, stateId);
|
||||
if (!state.visible) return null;
|
||||
const showVisual = definition.visual?.hidden !== true;
|
||||
if (!showVisual && !state.blocksMovement && !state.blocksSight) return null;
|
||||
return (
|
||||
<RigidBody
|
||||
key={`${definition.id}:${state.id}`}
|
||||
@@ -67,9 +72,9 @@ function WorldObject({
|
||||
sensor
|
||||
/>
|
||||
)}
|
||||
{definition.visual?.assetUrl
|
||||
{showVisual && (definition.visual?.assetUrl
|
||||
? <AssetObject definition={definition} />
|
||||
: <ProceduralObject definition={definition} />}
|
||||
: <ProceduralObject definition={definition} />)}
|
||||
</RigidBody>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user