Skip to content

Commit

Permalink
Merge pull request overte-org#1160 from AleziaKurdis/createApp_Equipa…
Browse files Browse the repository at this point in the history
…bleProperties

Create app: Grab and Equip
  • Loading branch information
ksuprynowicz authored Oct 22, 2024
2 parents 7ff372f + 56a57d5 commit 5b3cd71
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 34 deletions.
36 changes: 33 additions & 3 deletions scripts/system/create/assets/data/createAppTooltips.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,39 @@
"grab.grabbable": {
"tooltip": "If enabled, this entity will allow grabbing input and will be movable."
},
"grab.grabFollowsController": {
"tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand."
},
"grab.grabKinematic": {
"tooltip": "If enabled, this grabbed entity will be updated in a kinematic manner. If disabled, it will be grabbed using a tractor action. A kinematic grab will make the item appear more tightly held but will cause it to behave poorly when interacting with dynamic entities."
},
"grab.grabDelegateToParent": {
"tooltip": "If enabled, when the entity is grabbed, the grab will be transferred to its parent entity if there is one. If disabled, the grab won't be transferred, so a child entity can be grabbed and moved relative to its parent."
},
"grab.equippable": {
"tooltip": "If enabled, this entity can be attached to the hands/controllers in a simple click. (Note: Entities can't be equipped if 'ignorePickIntersection' is set to true.)"
},
"grab.equippableLeftPosition": {
"tooltip": "When equipped on an avatar, this defines the 'position' of the entity relative to the 'left' hand."
},
"grab.equippableLeftRotation": {
"tooltip": "When equipped on an avatar, this defines the 'rotation' of the entity relative to the 'left' hand."
},
"grab.equippableRightPosition": {
"tooltip": "When equipped on an avatar, this defines the 'position' of the entity relative to the 'right' hand."
},
"grab.equippableRightRotation": {
"tooltip": "When equipped on an avatar, this defines the 'rotation' of the entity relative to the 'right' hand."
},
"grab.equippableIndicatorURL": {
"tooltip": "If a model URL is specified, this model will be used to indicate that an entity is equippable."
},
"grab.equippableIndicatorScale": {
"tooltip": "If an 'Indicator URL' is specified, this controls the scale factors for each dimension of the displayed indicator."
},
"grab.equippableIndicatorOffset": {
"tooltip": "If an 'Indicator URL' is specified, this controls the relative offset of the displayed indicator from the equippable entity."
},
"grab.triggerable": {
"tooltip": "If enabled, the collider on this entity is used for triggering events."
},
Expand All @@ -597,9 +630,6 @@
"cloneAvatarEntity": {
"tooltip": "If enabled, then clones created from this entity will be created as avatar entities."
},
"grab.grabFollowsController": {
"tooltip": "If enabled, grabbed entities will follow the movements of your hand controller instead of your avatar's hand."
},
"canCastShadow": {
"tooltip": "If enabled, the geometry of this entity casts shadows when a shadow-casting light source shines on it. Note: Shadows are rendered only on high-profiled computers. This setting will have no effect on computers profiled to medium or low graphics."
},
Expand Down
159 changes: 128 additions & 31 deletions scripts/system/create/entityProperties/html/js/entityProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -1819,11 +1819,6 @@ const GROUPS = [
id: "behavior",
label: "BEHAVIOR",
properties: [
{
label: "Grabbable",
type: "bool",
propertyID: "grab.grabbable",
},
{
label: "Cloneable",
type: "bool",
Expand Down Expand Up @@ -1856,16 +1851,6 @@ const GROUPS = [
propertyID: "cloneAvatarEntity",
showPropertyRule: { "cloneable": "true" },
},
{
label: "Triggerable",
type: "bool",
propertyID: "grab.triggerable",
},
{
label: "Follow Controller",
type: "bool",
propertyID: "grab.grabFollowsController",
},
{
label: "Cast Shadows",
type: "bool",
Expand All @@ -1890,6 +1875,118 @@ const GROUPS = [
}
]
},
{
id: "grabAndEquip",
label: "GRAB AND EQUIP",
properties: [
{
label: "Grabbable",
type: "bool",
propertyID: "grab.grabbable",
},
{
label: "Follow Controller",
type: "bool",
propertyID: "grab.grabFollowsController",
showPropertyRule: { "grab.grabbable": "true" },
},
{
label: "Kinematic Grab",
type: "bool",
propertyID: "grab.grabKinematic",
showPropertyRule: { "grab.grabbable": "true" },
},
{
label: "Delegate To Parent",
type: "bool",
propertyID: "grab.grabDelegateToParent",
showPropertyRule: { "grab.grabbable": "true" },
},
{
label: "Triggerable",
type: "bool",
propertyID: "grab.triggerable",
},
{
label: "Equippable",
type: "bool",
propertyID: "grab.equippable",
},
{
label: "Left Position",
type: "vec3",
vec3Type: "xyz",
subLabels: [ "x", "y", "z" ],
step: 0.0025,
decimals: 4,
unit: "m",
propertyID: "grab.equippableLeftPosition",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Left Rotation",
type: "vec3",
vec3Type: "pyr",
step: 0.1,
decimals: 4,
subLabels: [ "x", "y", "z" ],
unit: "deg",
propertyID: "grab.equippableLeftRotation",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Right Position",
type: "vec3",
vec3Type: "xyz",
subLabels: [ "x", "y", "z" ],
step: 0.0025,
decimals: 4,
unit: "m",
propertyID: "grab.equippableRightPosition",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Right Rotation",
type: "vec3",
vec3Type: "pyr",
step: 0.1,
decimals: 4,
subLabels: [ "x", "y", "z" ],
unit: "deg",
propertyID: "grab.equippableRightRotation",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Indicator Model URL",
type: "string",
propertyID: "grab.equippableIndicatorURL",
placeholder: "URL",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Indicator Scale",
type: "vec3",
vec3Type: "xyz",
subLabels: [ "x", "y", "z" ],
step: 0.0025,
decimals: 4,
unit: "scale",
propertyID: "grab.equippableIndicatorScale",
showPropertyRule: { "grab.equippable": "true" },
},
{
label: "Indicator Offset",
type: "vec3",
vec3Type: "xyz",
subLabels: [ "x", "y", "z" ],
step: 0.005,
decimals: 4,
unit: "m",
propertyID: "grab.equippableIndicatorOffset",
showPropertyRule: { "grab.equippable": "true" },
},
]
},
{
id: "scripts",
label: "SCRIPTS",
Expand Down Expand Up @@ -2068,25 +2165,25 @@ const GROUPS = [
];

const GROUPS_PER_TYPE = {
None: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Shape: [ 'base', 'shape', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Text: [ 'base', 'text', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
None: [ 'base', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Shape: [ 'base', 'shape', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Text: [ 'base', 'text', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Zone: [ 'base', 'zone', 'zone_key_light', 'zone_skybox', 'zone_ambient_light', 'zone_haze',
'zone_bloom', 'zone_tonemapping', 'zone_ambient_occlusion', 'zone_avatar_priority',
'zone_audio', 'spatial', 'behavior', 'scripts', 'physics' ],
Model: [ 'base', 'model', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Image: [ 'base', 'image', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Web: [ 'base', 'web', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Light: [ 'base', 'light', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Material: [ 'base', 'material', 'spatial', 'behavior', 'scripts', 'physics' ],
'zone_audio', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
Model: [ 'base', 'model', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Image: [ 'base', 'image', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Web: [ 'base', 'web', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Light: [ 'base', 'light', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Material: [ 'base', 'material', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
ParticleEffect: [ 'base', 'particles', 'particles_emit', 'particles_size', 'particles_color',
'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'scripts', 'physics' ],
ProceduralParticleEffect: [ 'base', 'particles_procedural', 'spatial', 'behavior', 'scripts', 'physics' ],
PolyLine: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
PolyVox: [ 'base', 'polyvox', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
Grid: [ 'base', 'grid', 'spatial', 'behavior', 'scripts', 'physics' ],
Sound: [ 'base', 'sound', 'spatial', 'behavior', 'scripts', 'physics' ],
Multiple: [ 'base', 'spatial', 'behavior', 'scripts', 'collision', 'physics' ],
'particles_behavior', 'particles_constraints', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
ProceduralParticleEffect: [ 'base', 'particles_procedural', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
PolyLine: [ 'base', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
PolyVox: [ 'base', 'polyvox', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
Grid: [ 'base', 'grid', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
Sound: [ 'base', 'sound', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'physics' ],
Multiple: [ 'base', 'spatial', 'behavior', 'grabAndEquip', 'scripts', 'collision', 'physics' ],
};

const EDITOR_TIMEOUT_DURATION = 1500;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5b3cd71

Please sign in to comment.