This commit is contained in:
knowledgenude 2020-11-18 13:50:24 -03:00
parent ba7a897142
commit 17b4cb2028
17 changed files with 55 additions and 44 deletions

View file

@ -13,7 +13,7 @@ class GetCursorStateNode extends LogicNode {
return switch (from) { return switch (from) {
case 0: case 0:
mouse.hidden ? return false : mouse.locked ? return false : return true; mouse.hidden ? mouse.locked ? return true : return false;
case 1: case 1:
mouse.hidden; mouse.hidden;
case 2: case 2:

View file

@ -23,4 +23,4 @@ class GetDebugConsoleSettings extends LogicNode {
#end #end
return null; return null;
} }
} }

View file

@ -19,25 +19,32 @@ class GetRigidBodyDataNode extends LogicNode {
return switch (from) { return switch (from) {
case 0: case 0:
if (rb == null) return false; rb == null ? return false : return true;
return true; case 1:
rb.group;
case 1: rb.group; case 2:
case 2: rb.mask; rb.mask;
case 3: rb.animated; case 3:
case 4: rb.staticObj; rb.animated;
case 5: rb.angularDamping; case 4:
case 6: rb.linearDamping; rb.staticObj;
case 7: rb.friction; case 5:
case 8: rb.mass; rb.angularDamping;
case 6:
rb.linearDamping;
case 7:
rb.friction;
case 8:
rb.mass;
//case 9: ; // collision shape //case 9: ; // collision shape
//case 10: ; // activation state //case 10: ; // activation state
//case 11: ; // is gravity enabled //case 11: ; // is gravity enabled
//case 12: ; // angular factor //case 12: ; // angular factor
//case 13: ; // linear factor //case 13: ; // linear factor
default: null; default:
null;
} }
#end #end
} }
} }

View file

@ -45,10 +45,10 @@ class OnContactArrayNode extends LogicNode {
switch (property0) { switch (property0) {
case "begin": case "begin":
b = contact && !lastContact; b = contact && !lastContact;
case "end":
b = !contact && lastContact;
case "overlap": case "overlap":
b = contact; b = contact;
case "end":
b = !contact && lastContact;
} }
lastContact = contact; lastContact = contact;

View file

@ -44,10 +44,10 @@ class OnContactNode extends LogicNode {
switch (property0) { switch (property0) {
case "begin": case "begin":
b = contact && !lastContact; b = contact && !lastContact;
case "end":
b = !contact && lastContact;
case "overlap": case "overlap":
b = contact; b = contact;
case "end":
b = !contact && lastContact;
} }
lastContact = contact; lastContact = contact;

View file

@ -39,10 +39,10 @@ class OnVolumeTriggerNode extends LogicNode {
switch (property0) { switch (property0) {
case "enter": case "enter":
b = overlap && !lastOverlap; b = overlap && !lastOverlap;
case "leave":
b = !overlap && lastOverlap;
case "overlap": case "overlap":
b = overlap; b = overlap;
case "leave":
b = !overlap && lastOverlap;
} }
lastOverlap = overlap; lastOverlap = overlap;

View file

@ -11,12 +11,14 @@ class RemovePhysicsNode extends LogicNode {
override function run(from: Int) { override function run(from: Int) {
var object: Object = inputs[1].get(); var object: Object = inputs[1].get();
if (object == null) return; if (object == null) return;
#if arm_physics #if arm_physics
var rigidBody = object.getTrait(RigidBody); var rigidBody = object.getTrait(RigidBody);
rigidBody.remove(); rigidBody.remove();
#end #end
runOutput(0); runOutput(0);
} }

View file

@ -21,7 +21,7 @@ class SetActivationStateNode extends LogicNode {
var object: Object = inputs[1].get(); var object: Object = inputs[1].get();
if (object == null) return; if (object == null) return;
#if arm_physics #if arm_physics
var rigidBody = object.getTrait(RigidBody); var rigidBody = object.getTrait(RigidBody);
switch (property0) { switch (property0) {
@ -36,7 +36,7 @@ class SetActivationStateNode extends LogicNode {
} }
rigidBody.setActivationState(state); rigidBody.setActivationState(state);
#end #end
runOutput(0); runOutput(0);
} }

View file

@ -19,11 +19,11 @@ class SetDebugConsoleSettings extends LogicNode {
armory.trait.internal.DebugConsole.setScale(scale); armory.trait.internal.DebugConsole.setScale(scale);
switch (property0) { switch (property0) {
case "anchor left": case "left":
return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.LEFT); return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.LEFT);
case "anchor center": case "center":
return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.CENTER); return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.CENTER);
case "anchor right": case "right":
return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.RIGHT); return armory.trait.internal.DebugConsole.setPosition(PositionStateEnum.RIGHT);
} }
#end #end

View file

@ -11,14 +11,16 @@ class SetFrictionNode extends LogicNode {
override function run(from: Int) { override function run(from: Int) {
var object: Object = inputs[1].get(); var object: Object = inputs[1].get();
if (object == null) return; if (object == null) return;
var friction: Float = inputs[2].get(); var friction = inputs[2].get();
#if arm_physics #if arm_physics
var rigidBody = object.getTrait(RigidBody); var rigidBody = object.getTrait(RigidBody);
rigidBody.setFriction(friction); rigidBody.setFriction(friction);
#end #end
runOutput(0); runOutput(0);
} }

View file

@ -27,10 +27,10 @@ class VolumeTriggerNode extends LogicNode {
switch (property0) { switch (property0) {
case "enter": case "enter":
b = overlap && !lastOverlap; b = overlap && !lastOverlap;
case "leave":
b = !overlap && lastOverlap;
case "overlap": case "overlap":
b = overlap; b = overlap;
case "leave":
b = !overlap && lastOverlap;
} }
lastOverlap = overlap; lastOverlap = overlap;

View file

@ -16,9 +16,9 @@ class OnCanvasElementNode(ArmLogicTreeNode):
('released', 'Released', 'Released')], ('released', 'Released', 'Released')],
name='Status', default='started') name='Status', default='started')
property2: EnumProperty( property2: EnumProperty(
items=[('left', 'Left', 'Left Button'), items=[('left', 'Left', 'Left mouse button'),
('middle', 'Middle', 'Middle Button'), ('middle', 'Middle', 'Middle mouse button'),
('right', 'Right', 'Right Button')], ('right', 'Right', 'Right mouse button')],
name='Mouse Button', default='left') name='Mouse Button', default='left')
def init(self, context): def init(self, context):

View file

@ -7,10 +7,10 @@ class SetDebugConsoleSettings(ArmLogicTreeNode):
arm_version = 1 arm_version = 1
property0: EnumProperty( property0: EnumProperty(
items = [('anchor left', 'Anchor Left', 'Anchor debug console in the top left'), items = [('left', 'Anchor Left', 'Anchor debug console in the top left'),
('anchor center', 'Anchor Center', 'Anchor debug console in the top center'), ('center', 'Anchor Center', 'Anchor debug console in the top center'),
('anchor right', 'Anchor Right', 'Anchor the debug console in the top right')], ('right', 'Anchor Right', 'Anchor the debug console in the top right')],
name='', default='anchor right') name='', default='right')
def init(self, context): def init(self, context):
super(SetDebugConsoleSettings, self).init(context) super(SetDebugConsoleSettings, self).init(context)

View file

@ -17,7 +17,7 @@ class OnContactNode(ArmLogicTreeNode):
arm_version = 1 arm_version = 1
property0: EnumProperty( property0: EnumProperty(
items = [('begin', 'Begin', 'The contact between the rigid bodies starts'), items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'), ('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
('end', 'End', 'The contact between the rigid bodies ends')], ('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin') name='', default='begin')

View file

@ -8,7 +8,7 @@ class OnContactArrayNode(ArmLogicTreeNode):
arm_version = 1 arm_version = 1
property0: EnumProperty( property0: EnumProperty(
items = [('begin', 'Begin', 'The contact between the rigid bodies starts'), items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'), ('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
('end', 'End', 'The contact between the rigid bodies ends')], ('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin') name='', default='begin')

View file

@ -11,7 +11,7 @@ class OnVolumeTriggerNode(ArmLogicTreeNode):
arm_version = 1 arm_version = 1
property0: EnumProperty( property0: EnumProperty(
items = [('begin', 'Begin', 'The contact between the rigid bodies starts'), items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'), ('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
('end', 'End', 'The contact between the rigid bodies ends')], ('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin') name='', default='begin')

View file

@ -13,7 +13,7 @@ class VolumeTriggerNode(ArmLogicTreeNode):
arm_version = 1 arm_version = 1
property0: EnumProperty( property0: EnumProperty(
items = [('begin', 'Begin', 'The contact between the rigid bodies starts'), items = [('begin', 'Begin', 'The contact between the rigid bodies begins'),
('overlap', 'Overlap', 'The contact between the rigid bodies is happening'), ('overlap', 'Overlap', 'The contact between the rigid bodies is happening'),
('end', 'End', 'The contact between the rigid bodies ends')], ('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin') name='', default='begin')