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) {
case 0:
mouse.hidden ? return false : mouse.locked ? return false : return true;
mouse.hidden ? mouse.locked ? return true : return false;
case 1:
mouse.hidden;
case 2:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,14 +11,16 @@ class SetFrictionNode extends LogicNode {
override function run(from: Int) {
var object: Object = inputs[1].get();
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);
rigidBody.setFriction(friction);
#end
#end
runOutput(0);
}

View file

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

View file

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

View file

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

View file

@ -17,7 +17,7 @@ class OnContactNode(ArmLogicTreeNode):
arm_version = 1
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'),
('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin')

View file

@ -8,7 +8,7 @@ class OnContactArrayNode(ArmLogicTreeNode):
arm_version = 1
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'),
('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin')

View file

@ -11,7 +11,7 @@ class OnVolumeTriggerNode(ArmLogicTreeNode):
arm_version = 1
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'),
('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin')

View file

@ -13,7 +13,7 @@ class VolumeTriggerNode(ArmLogicTreeNode):
arm_version = 1
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'),
('end', 'End', 'The contact between the rigid bodies ends')],
name='', default='begin')