Skip to content

Commit

Permalink
feat(ocean): add ocean primitive to schema (#525)
Browse files Browse the repository at this point in the history
* tubular

* add ocean object
  • Loading branch information
mwfarb authored Mar 23, 2023
1 parent 7cd11f0 commit ec41bbc
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 5 deletions.
5 changes: 5 additions & 0 deletions build/schemas/arena-schema-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
"file":"schemas/line.json",
"title":"Line"
},
"ocean":{
"description":"Ocean",
"file":"schemas/ocean.json",
"title":"Ocean"
},
"octahedron":{
"description":"Octahedron Geometry",
"file":"schemas/octahedron.json",
Expand Down
1 change: 1 addition & 0 deletions build/schemas/capsule.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"default": {
"object_type": "capsule",
"radius": 1,
"length": 1,
"material": {
"color": "#7f7f7f"
},
Expand Down
2 changes: 1 addition & 1 deletion build/schemas/cone.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"additionalProperties": true,
"default": {
"object_type": "cone",
"height": 2,
"height": 1,
"radiusBottom": 1,
"material": {
"color": "#7f7f7f"
Expand Down
2 changes: 1 addition & 1 deletion build/schemas/cylinder.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"additionalProperties": true,
"default": {
"object_type": "cylinder",
"height": 2,
"height": 1,
"radius": 1,
"material": {
"color": "#7f7f7f"
Expand Down
6 changes: 4 additions & 2 deletions build/schemas/definitions-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -830,8 +830,9 @@
"#FF0000"
],
"items": {
"format": "color",
"type": "string"
}
}
},
"size": {
"description": "Describes a particle's size.",
Expand Down Expand Up @@ -1007,8 +1008,9 @@
"type": "array",
"maxItems": 4,
"items": {
"format": "color",
"type": "string"
}
}
},
"colorSpread": {
"description": "spread to apply to colors, spread an array of vec3 (r g b) with 0 for no spread. note the spread will be re-applied through-out the lifetime of the particle",
Expand Down
107 changes: 107 additions & 0 deletions build/schemas/ocean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"title": "Ocean",
"description": "Flat-shaded ocean primitive.",
"allOf": [
{
"$ref": "./schemas/definitions-arena-object.json#/properties"
},
{
"properties": {
"data": {
"allOf": [
{
"properties": {
"object_type": {
"type": "string",
"title": "3D object type",
"description": "3D object type (derived from 'type' select above).",
"enum": [
"ocean"
]
},
"width": {
"description": "Width of the ocean area.",
"default": 10,
"minValue": 0,
"type": "number"
},
"depth": {
"description": "Depth of the ocean area.",
"default": 10,
"minValue": 0,
"type": "number"
},
"density": {
"description": "Density of waves.",
"default": 10,
"type": "number"
},
"amplitude": {
"description": "Wave amplitude.",
"default": 0.1,
"type": "number"
},
"amplitudeVariance": {
"description": "Wave amplitude variance.",
"default": 0.3,
"type": "number"
},
"speed": {
"description": "Wave speed.",
"default": 1,
"type": "number"
},
"speedVariance": {
"description": "Wave speed variance.",
"default": 2,
"type": "number"
},
"color": {
"description": "Wave color.",
"default": "#7AD2F7",
"format": "color",
"type": "string"
},
"opacity": {
"description": "Wave opacity.",
"default": 0.8,
"type": "number"
}
}
},
{
"$ref": "./schemas/definitions-entity.json#/properties"
}
],
"title": "Ocean Data",
"additionalProperties": true,
"default": {
"object_type": "ocean",
"width": 10,
"depth": 10,
"color": "#7AD2F7",
"rotation": {
"w": -0.70711,
"x": 0.70711,
"y": 0,
"z": 0
}
},
"required": [
"object_type",
"width",
"depth",
"color"
]
}
}
}
],
"required": [
"object_id",
"action",
"type",
"data",
"persist"
]
}
3 changes: 2 additions & 1 deletion build/schemas/plane.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"additionalProperties": true,
"default": {
"object_type": "plane",
"width": 1,
"height": 1,
"material": {
"color": "#7f7f7f"
},
Expand All @@ -63,7 +65,6 @@
"y": 0,
"z": 0
},
"radius": 1,
"rotation": {
"w": 1,
"x": 0,
Expand Down
1 change: 1 addition & 0 deletions build/schemas/torus.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"default": {
"object_type": "torus",
"radius": 1,
"radiusTubular": 0.4,
"material": {
"color": "#7f7f7f"
},
Expand Down
1 change: 1 addition & 0 deletions build/schemas/torusKnot.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"default": {
"object_type": "torusKnot",
"radius": 1,
"radiusTubular": 0.4,
"material": {
"color": "#7f7f7f"
},
Expand Down

0 comments on commit ec41bbc

Please sign in to comment.