Class SCNPhysicsBody

    • Constructor Detail

      • SCNPhysicsBody

        protected SCNPhysicsBody​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • bodyWithTypeShape

        public static SCNPhysicsBody bodyWithTypeShape​(long type,
                                                       SCNPhysicsShape shape)
        Creates an instance of a rigid body with a specific shape.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • dynamicBody

        public static java.lang.Object dynamicBody()
        Creates an instance of a dynamic body with default properties.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • kinematicBody

        public static java.lang.Object kinematicBody()
        Creates an instance of a kinematic body with default properties.
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • staticBody

        public static java.lang.Object staticBody()
        Creates an instance of a static body with default properties.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • allowsResting

        public boolean allowsResting()
        Specifies if the receiver can be set at rest.
      • angularDamping

        public double angularDamping()
        Specifies the angular damping of the receiver. Optionally reduce the body's angular velocity each frame to simulate rotational friction. (0.0 - 1.0). Defaults to 0.1.
      • angularVelocity

        public SCNVector4 angularVelocity()
        Specifies the angular velocity of the receiver as an axis angle.
      • angularVelocityFactor

        public SCNVector3 angularVelocityFactor()
        Specifies a factor applied on the rotation on each axis that results from the physics simulation before applying it to the node.
      • applyForceAtPositionImpulse

        public void applyForceAtPositionImpulse​(SCNVector3 direction,
                                                SCNVector3 position,
                                                boolean impulse)
        Applies a linear force with the specified position and direction. The position is relative to the node that owns the physics body.
      • applyForceImpulse

        public void applyForceImpulse​(SCNVector3 direction,
                                      boolean impulse)
        Applies a linear force in the specified direction. The linear force is applied on the center of mass of the receiver. If impulse is set to YES then the force is applied for just one frame, otherwise it applies a continuous force.
      • applyTorqueImpulse

        public void applyTorqueImpulse​(SCNVector4 torque,
                                       boolean impulse)
        Applies an angular force (torque). If impulse is set to YES then the force is applied for just one frame, otherwise it applies a continuous force. The torque is specified as an axis angle.
      • categoryBitMask

        public long categoryBitMask()
        Defines what logical 'categories' this body belongs too. Defaults to SCNPhysicsCollisionCategoryStatic for static bodies and SCNPhysicsCollisionCategoryDefault for the other body types. limited to the first 15 bits on macOS 10.10 and iOS 8.
      • charge

        public double charge()
        Specifies the charge on the body. Charge determines the degree to which a body is affected by electric and magnetic fields. Note that this is a unitless quantity, it is up to the developer to set charge and field strength appropriately. Defaults to 0.0
      • clearAllForces

        public void clearAllForces()
        Clears the forces applied one the receiver.
      • collisionBitMask

        public long collisionBitMask()
        Defines what logical 'categories' of bodies this body responds to collisions with. Defaults to all bits set (all categories).
      • contactTestBitMask

        public long contactTestBitMask()
        A mask that defines which categories of bodies cause intersection notifications with this physics body. Defaults to 0. On iOS 8 and macOS 10.10 and lower the intersection notifications are always sent when a collision occurs.
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • damping

        public double damping()
        Specifies the damping factor of the receiver. Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1.
      • friction

        public double friction()
        Specifies the force resisting the relative motion of solid sliding against each other. Defaults to 0.5.
      • isAffectedByGravity

        public boolean isAffectedByGravity()
        If set to YES this node will be affected by gravity. The default is YES.
      • setAffectedByGravity

        public void setAffectedByGravity​(boolean value)
        If set to YES this node will be affected by gravity. The default is YES.
      • isResting

        public boolean isResting()
        If the physics simulation has determined that this body is at rest it may set the resting property to YES. Resting bodies do not participate in the simulation until some collision with a non-resting object, or an impulse is applied, that unrests it. If all bodies in the world are resting then the simulation as a whole is "at rest".
      • mass

        public double mass()
        Specifies the Mass of the body in kilogram. Defaults to 1 for dynamic bodies, defaults to 0 for static bodies.
      • momentOfInertia

        public SCNVector3 momentOfInertia()
        Specifies the moment of inertia of the body as a vector in 3D. Disable usesDefaultMomentOfInertia for this value to be used instead of the default moment of inertia that is calculated from the shape geometry.
      • physicsShape

        public SCNPhysicsShape physicsShape()
        Specifies the physics shape of the receiver. Leaving this nil will let the system decide and use the most efficients bounding representation of the actual geometry.
      • resetTransform

        public void resetTransform()
        Reset the physical transform to the node's model transform.
      • restitution

        public double restitution()
        Specifies the restitution of collisions. Defaults to 0.5.
      • rollingFriction

        public double rollingFriction()
        Specifies the force resisting the relative motion of solid rolling against each other. Defaults to 0.
      • setAllowsResting

        public void setAllowsResting​(boolean value)
        Specifies if the receiver can be set at rest.
      • setAngularDamping

        public void setAngularDamping​(double value)
        Specifies the angular damping of the receiver. Optionally reduce the body's angular velocity each frame to simulate rotational friction. (0.0 - 1.0). Defaults to 0.1.
      • setAngularVelocity

        public void setAngularVelocity​(SCNVector4 value)
        Specifies the angular velocity of the receiver as an axis angle.
      • setAngularVelocityFactor

        public void setAngularVelocityFactor​(SCNVector3 value)
        Specifies a factor applied on the rotation on each axis that results from the physics simulation before applying it to the node.
      • setCategoryBitMask

        public void setCategoryBitMask​(long value)
        Defines what logical 'categories' this body belongs too. Defaults to SCNPhysicsCollisionCategoryStatic for static bodies and SCNPhysicsCollisionCategoryDefault for the other body types. limited to the first 15 bits on macOS 10.10 and iOS 8.
      • setCharge

        public void setCharge​(double value)
        Specifies the charge on the body. Charge determines the degree to which a body is affected by electric and magnetic fields. Note that this is a unitless quantity, it is up to the developer to set charge and field strength appropriately. Defaults to 0.0
      • setCollisionBitMask

        public void setCollisionBitMask​(long value)
        Defines what logical 'categories' of bodies this body responds to collisions with. Defaults to all bits set (all categories).
      • setContactTestBitMask

        public void setContactTestBitMask​(long value)
        A mask that defines which categories of bodies cause intersection notifications with this physics body. Defaults to 0. On iOS 8 and macOS 10.10 and lower the intersection notifications are always sent when a collision occurs.
      • setDamping

        public void setDamping​(double value)
        Specifies the damping factor of the receiver. Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1.
      • setFriction

        public void setFriction​(double value)
        Specifies the force resisting the relative motion of solid sliding against each other. Defaults to 0.5.
      • setMass

        public void setMass​(double value)
        Specifies the Mass of the body in kilogram. Defaults to 1 for dynamic bodies, defaults to 0 for static bodies.
      • setMomentOfInertia

        public void setMomentOfInertia​(SCNVector3 value)
        Specifies the moment of inertia of the body as a vector in 3D. Disable usesDefaultMomentOfInertia for this value to be used instead of the default moment of inertia that is calculated from the shape geometry.
      • setPhysicsShape

        public void setPhysicsShape​(SCNPhysicsShape value)
        Specifies the physics shape of the receiver. Leaving this nil will let the system decide and use the most efficients bounding representation of the actual geometry.
      • setRestitution

        public void setRestitution​(double value)
        Specifies the restitution of collisions. Defaults to 0.5.
      • setRollingFriction

        public void setRollingFriction​(double value)
        Specifies the force resisting the relative motion of solid rolling against each other. Defaults to 0.
      • setType

        public void setType​(long value)
        Specifies the type of the receiver.
      • setUsesDefaultMomentOfInertia

        public void setUsesDefaultMomentOfInertia​(boolean value)
        Permits to disable the use of the default moment of inertia in favor of the one stored in momentOfInertia.
      • setVelocity

        public void setVelocity​(SCNVector3 value)
        Specifies the linear velocity of the receiver.
      • setVelocityFactor

        public void setVelocityFactor​(SCNVector3 value)
        Specifies a factor applied on the translation that results from the physics simulation before applying it to the node.
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • type

        public long type()
        Specifies the type of the receiver.
      • usesDefaultMomentOfInertia

        public boolean usesDefaultMomentOfInertia()
        Permits to disable the use of the default moment of inertia in favor of the one stored in momentOfInertia.
      • velocity

        public SCNVector3 velocity()
        Specifies the linear velocity of the receiver.
      • velocityFactor

        public SCNVector3 velocityFactor()
        Specifies a factor applied on the translation that results from the physics simulation before applying it to the node.
      • angularRestingThreshold

        public double angularRestingThreshold()
        Angular velocity threshold under which the body may be considered resting. Defaults to 0.1.
      • centerOfMassOffset

        public SCNVector3 centerOfMassOffset()
        Specifies an offset for the center of mass of the body. Defaults to (0,0,0).
      • continuousCollisionDetectionThreshold

        public double continuousCollisionDetectionThreshold()
        Use discrete collision detection if the body’s distance traveled in one step is at or below this threshold, or continuous collision detection otherwise. Defaults to zero, indicating that continuous collision detection is always disabled.
      • linearRestingThreshold

        public double linearRestingThreshold()
        Linear velocity threshold under which the body may be considered resting. Defaults to 0.1.
      • setAngularRestingThreshold

        public void setAngularRestingThreshold​(double value)
        Angular velocity threshold under which the body may be considered resting. Defaults to 0.1.
      • setCenterOfMassOffset

        public void setCenterOfMassOffset​(SCNVector3 value)
        Specifies an offset for the center of mass of the body. Defaults to (0,0,0).
      • setContinuousCollisionDetectionThreshold

        public void setContinuousCollisionDetectionThreshold​(double value)
        Use discrete collision detection if the body’s distance traveled in one step is at or below this threshold, or continuous collision detection otherwise. Defaults to zero, indicating that continuous collision detection is always disabled.
      • setLinearRestingThreshold

        public void setLinearRestingThreshold​(double value)
        Linear velocity threshold under which the body may be considered resting. Defaults to 0.1.
      • setResting

        public void setResting​(boolean resting)
        Sets a physics body at rest (or not)