fixed move & rotate tweens + mapping to child OK
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"children": [
|
||||
{
|
||||
"type": "Mesh",
|
||||
"idSuffix": "head",
|
||||
"childSuffix": "head",
|
||||
"geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] },
|
||||
"material": { "type": "MeshStandardMaterial", "color": "blue" },
|
||||
"position": [0, 0.5, 0]
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"arenaSize": {
|
||||
"x": 100,
|
||||
"y": 100,
|
||||
"z": 100
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
[
|
||||
{
|
||||
"chan": "gps:agents",
|
||||
"events": [
|
||||
{
|
||||
"eventName": "move",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"assign": {
|
||||
"position.x": "coords.x",
|
||||
"position.z": "coords.y",
|
||||
"position.y": "coords.z"
|
||||
},
|
||||
"tween": true,
|
||||
"tweenDelay": 1000
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chan": "agent:*",
|
||||
"events": [
|
||||
{
|
||||
"eventName": "age",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"assign": {
|
||||
"fill": {
|
||||
"arguments": ["age"],
|
||||
"transformer": "rgb(${Math.round(255 * age / 10)},0,${Math.round(255 * (1 - age / 10))})"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"eventName": "rotate",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"assign": {
|
||||
"rotation.x": "facing.x",
|
||||
"rotation.y": "facing.y",
|
||||
"rotation.z": "facing.z"
|
||||
},
|
||||
"tween": true,
|
||||
"tweenDelay": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -3,7 +3,7 @@
|
||||
"chan": "gps:agents",
|
||||
"events": [
|
||||
{
|
||||
"eventName": "moving",
|
||||
"eventName": "move",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
@@ -16,35 +16,46 @@
|
||||
"tweenDelay": 1000
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chan": "agents:*",
|
||||
"events": [
|
||||
{
|
||||
"eventName": "rotating",
|
||||
"eventName": "age",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"assign": {
|
||||
"r": "rotangle"
|
||||
"material.color": "color"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"eventName": "rotate",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"assign": {
|
||||
"rotation.x": "facing.x",
|
||||
"rotation.y": "facing.y",
|
||||
"rotation.z": "facing.z"
|
||||
},
|
||||
"tween": true,
|
||||
"tweenDelay": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"chan": "agent:*",
|
||||
"events": [
|
||||
},
|
||||
{
|
||||
"eventName": "aging",
|
||||
"eventName": "polarize",
|
||||
"mappings": [
|
||||
{
|
||||
"id": "aid",
|
||||
"child": "head",
|
||||
"assign": {
|
||||
"fill": {
|
||||
"arguments": ["age"],
|
||||
"transformer": "rgb(${Math.round(255 * age / 10)},0,${Math.round(255 * (1 - age / 10))})"
|
||||
}
|
||||
"material.color": "color"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user