Package apple.spritekit
Class SKPhysicsBody
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.spritekit.SKPhysicsBody
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSSecureCoding,NSObject
public class SKPhysicsBody extends NSObject implements NSCopying, NSSecureCoding
A SpriteKit physics body. These are the physical representations of your nodes. These specify the area and mass and any collision masking needed. All bodies have zero, one or more shapes that define its area. A body with no shapes is ethereal and does not collide with other bodies.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Block_accessibilityActivateBlock_ret, NSObject.Block_accessibilityActivationPointBlock_ret, NSObject.Block_accessibilityAttributedHintBlock_ret, NSObject.Block_accessibilityAttributedLabelBlock_ret, NSObject.Block_accessibilityAttributedUserInputLabelsBlock_ret, NSObject.Block_accessibilityAttributedValueBlock_ret, NSObject.Block_accessibilityContainerTypeBlock_ret, NSObject.Block_accessibilityCustomActionsBlock_ret, NSObject.Block_accessibilityCustomRotorsBlock_ret, NSObject.Block_accessibilityDecrementBlock_ret, NSObject.Block_accessibilityElementsBlock_ret, NSObject.Block_accessibilityElementsHiddenBlock_ret, NSObject.Block_accessibilityFrameBlock_ret, NSObject.Block_accessibilityHeaderElementsBlock_ret, NSObject.Block_accessibilityHintBlock_ret, NSObject.Block_accessibilityIdentifierBlock_ret, NSObject.Block_accessibilityIncrementBlock_ret, NSObject.Block_accessibilityLabelBlock_ret, NSObject.Block_accessibilityLanguageBlock_ret, NSObject.Block_accessibilityMagicTapBlock_ret, NSObject.Block_accessibilityNavigationStyleBlock_ret, NSObject.Block_accessibilityPathBlock_ret, NSObject.Block_accessibilityPerformEscapeBlock_ret, NSObject.Block_accessibilityRespondsToUserInteractionBlock_ret, NSObject.Block_accessibilityShouldGroupAccessibilityChildrenBlock_ret, NSObject.Block_accessibilityTextualContextBlock_ret, NSObject.Block_accessibilityTraitsBlock_ret, NSObject.Block_accessibilityUserInputLabelsBlock_ret, NSObject.Block_accessibilityValueBlock_ret, NSObject.Block_accessibilityViewIsModalBlock_ret, NSObject.Block_automationElementsBlock_ret, NSObject.Block_isAccessibilityElementBlock_ret, NSObject.Block_setAccessibilityActivateBlock, NSObject.Block_setAccessibilityActivationPointBlock, NSObject.Block_setAccessibilityAttributedHintBlock, NSObject.Block_setAccessibilityAttributedLabelBlock, NSObject.Block_setAccessibilityAttributedUserInputLabelsBlock, NSObject.Block_setAccessibilityAttributedValueBlock, NSObject.Block_setAccessibilityContainerTypeBlock, NSObject.Block_setAccessibilityCustomActionsBlock, NSObject.Block_setAccessibilityCustomRotorsBlock, NSObject.Block_setAccessibilityDecrementBlock, NSObject.Block_setAccessibilityElementsBlock, NSObject.Block_setAccessibilityElementsHiddenBlock, NSObject.Block_setAccessibilityFrameBlock, NSObject.Block_setAccessibilityHeaderElementsBlock, NSObject.Block_setAccessibilityHintBlock, NSObject.Block_setAccessibilityIdentifierBlock, NSObject.Block_setAccessibilityIncrementBlock, NSObject.Block_setAccessibilityLabelBlock, NSObject.Block_setAccessibilityLanguageBlock, NSObject.Block_setAccessibilityMagicTapBlock, NSObject.Block_setAccessibilityNavigationStyleBlock, NSObject.Block_setAccessibilityPathBlock, NSObject.Block_setAccessibilityPerformEscapeBlock, NSObject.Block_setAccessibilityRespondsToUserInteractionBlock, NSObject.Block_setAccessibilityShouldGroupAccessibilityChildrenBlock, NSObject.Block_setAccessibilityTextualContextBlock, NSObject.Block_setAccessibilityTraitsBlock, NSObject.Block_setAccessibilityUserInputLabelsBlock, NSObject.Block_setAccessibilityValueBlock, NSObject.Block_setAccessibilityViewIsModalBlock, NSObject.Block_setAutomationElementsBlock, NSObject.Block_setIsAccessibilityElementBlock, NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSKPhysicsBody(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()booleanaffectedByGravity()Bodies are affected by field forces such as gravity if this property is set and the field's category mask is set appropriately.@NotNull NSArray<? extends SKPhysicsBody>allContactedBodies()Returns an array of all SKPhysicsBodies currently in contact with this onestatic SKPhysicsBodyalloc()static SKPhysicsBodyallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanallowsRotation()doubleangularDamping()Optionally reduce the body's angular velocity each frame to simulate rotational friction.doubleangularVelocity()voidapplyAngularImpulse(double impulse)voidapplyForce(CGVector force)voidapplyForceAtPoint(CGVector force, CGPoint point)voidapplyImpulse(CGVector impulse)voidapplyImpulseAtPoint(CGVector impulse, CGPoint point)voidapplyTorque(double torque)doublearea()The area of the body.static booleanautomaticallyNotifiesObserversForKey(@NotNull java.lang.String key)static @NotNull SKPhysicsBodybodyWithBodies(@NotNull NSArray<? extends SKPhysicsBody> bodies)Creates an compound body that is the union of the bodies used to create it.static @NotNull SKPhysicsBodybodyWithCircleOfRadius(double r)Creates a circle of radius r centered at the node's origin.static @NotNull SKPhysicsBodybodyWithCircleOfRadiusCenter(double r, CGPoint center)Creates a circle of radius r centered at a point in the node's coordinate space.static @NotNull SKPhysicsBodybodyWithEdgeChainFromPath(@NotNull CGPathRef path)Creates an edge chain from a path.static @NotNull SKPhysicsBodybodyWithEdgeFromPointToPoint(CGPoint p1, CGPoint p2)Creates an edge from p1 to p2.static @NotNull SKPhysicsBodybodyWithEdgeLoopFromPath(@NotNull CGPathRef path)Creates an edge loop from a path.static @NotNull SKPhysicsBodybodyWithEdgeLoopFromRect(CGRect rect)Creates an edge loop from a CGRect.static @NotNull SKPhysicsBodybodyWithPolygonFromPath(@NotNull CGPathRef path)The path must represent a convex or concave polygon with counter clockwise winding and no self intersection.static @NotNull SKPhysicsBodybodyWithRectangleOfSize(CGSize s)Creates a rectangle of the specified size centered at the node's origin.static @NotNull SKPhysicsBodybodyWithRectangleOfSizeCenter(CGSize s, CGPoint center)Creates a rectangle of the specified size centered at a point in the node's coordinate space.static @NotNull SKPhysicsBodybodyWithTextureAlphaThresholdSize(@NotNull SKTexture texture, float alphaThreshold, CGSize size)Creates a body from the alpha values in the supplied texture.static @NotNull SKPhysicsBodybodyWithTextureSize(@NotNull SKTexture texture, CGSize size)Creates a body from the alpha values in the supplied texture.static voidcancelPreviousPerformRequestsWithTarget(@NotNull java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull java.lang.Object aTarget, @NotNull org.moe.natj.objc.SEL aSelector, @Nullable java.lang.Object anArgument)intcategoryBitMask()Defines what logical 'categories' this body belongs to.doublecharge()Specifies the charge on the body.static @NotNull NSArray<java.lang.String>classFallbacksForKeyedArchiver()static @NotNull org.moe.natj.objc.ClassclassForKeyedUnarchiver()intcollisionBitMask()Defines what logical 'categories' of bodies this body responds to collisions with.intcontactTestBitMask()Defines what logical 'categories' of bodies this body generates intersection notifications with.@NotNull java.lang.ObjectcopyWithZone(@Nullable org.moe.natj.general.ptr.VoidPtr zone)static java.lang.StringdebugDescription_static()doubledensity()The density of the body.static java.lang.Stringdescription_static()voidencodeWithCoder(@NotNull NSCoder coder)intfieldBitMask()Defines what logical 'categories' of fields this body responds to.doublefriction()Determines the 'roughness' for the surface of the physics body (0.0 - 1.0).static longhash_static()SKPhysicsBodyinit()SKPhysicsBodyinitWithCoder(@NotNull NSCoder coder)NS_DESIGNATED_INITIALIZERstatic NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisDynamic()booleanisResting()If the physics simulation has determined that this body is at rest it may set the resting property to YES.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)@NotNull NSArray<? extends SKPhysicsJoint>joints()static @NotNull NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(@NotNull java.lang.String key)doublelinearDamping()Optionally reduce the body's linear velocity each frame to simulate fluid/air friction.doublemass()The mass of the body.static SKPhysicsBodynew_objc()@Nullable SKNodenode()The representedObject this physicsBody is currently bound to, or nil if it is not.booleanpinned()API-Since: 8.0static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)doublerestitution()Determines the 'bounciness' of the physics body (0.0 - 1.0).voidsetAffectedByGravity(boolean value)Bodies are affected by field forces such as gravity if this property is set and the field's category mask is set appropriately.voidsetAllowsRotation(boolean value)voidsetAngularDamping(double value)Optionally reduce the body's angular velocity each frame to simulate rotational friction.voidsetAngularVelocity(double value)voidsetCategoryBitMask(int value)Defines what logical 'categories' this body belongs to.voidsetCharge(double value)Specifies the charge on the body.voidsetCollisionBitMask(int value)Defines what logical 'categories' of bodies this body responds to collisions with.voidsetContactTestBitMask(int value)Defines what logical 'categories' of bodies this body generates intersection notifications with.voidsetDensity(double value)The density of the body.voidsetDynamic(boolean value)voidsetFieldBitMask(int value)Defines what logical 'categories' of fields this body responds to.voidsetFriction(double value)Determines the 'roughness' for the surface of the physics body (0.0 - 1.0).voidsetLinearDamping(double value)Optionally reduce the body's linear velocity each frame to simulate fluid/air friction.voidsetMass(double value)The mass of the body.voidsetPinned(boolean value)API-Since: 8.0voidsetResting(boolean value)If the physics simulation has determined that this body is at rest it may set the resting property to YES.voidsetRestitution(double value)Determines the 'bounciness' of the physics body (0.0 - 1.0).voidsetUsesPreciseCollisionDetection(boolean value)voidsetVelocity(CGVector value)static voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()booleanusesPreciseCollisionDetection()static booleanuseStoredAccessor()Deprecated.CGVectorvelocity()static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivateBlock, accessibilityActivationPoint, accessibilityActivationPointBlock, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedHintBlock, accessibilityAttributedLabel, accessibilityAttributedLabelBlock, accessibilityAttributedUserInputLabels, accessibilityAttributedUserInputLabelsBlock, accessibilityAttributedValue, accessibilityAttributedValueBlock, accessibilityContainerType, accessibilityContainerTypeBlock, accessibilityCustomActions, accessibilityCustomActionsBlock, accessibilityCustomRotors, accessibilityCustomRotorsBlock, accessibilityDecrement, accessibilityDecrementBlock, accessibilityDirectTouchOptions, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsBlock, accessibilityElementsHidden, accessibilityElementsHiddenBlock, accessibilityFrame, accessibilityFrameBlock, accessibilityHeaderElementsBlock, accessibilityHint, accessibilityHintBlock, accessibilityIdentifierBlock, accessibilityIncrement, accessibilityIncrementBlock, accessibilityLabel, accessibilityLabelBlock, accessibilityLanguage, accessibilityLanguageBlock, accessibilityMagicTapBlock, accessibilityNavigationStyle, accessibilityNavigationStyleBlock, accessibilityPath, accessibilityPathBlock, accessibilityPerformEscape, accessibilityPerformEscapeBlock, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityRespondsToUserInteractionBlock, accessibilityScroll, accessibilityShouldGroupAccessibilityChildrenBlock, accessibilityTextualContext, accessibilityTextualContextBlock, accessibilityTraits, accessibilityTraitsBlock, accessibilityUserInputLabels, accessibilityUserInputLabelsBlock, accessibilityValue, accessibilityValueBlock, accessibilityViewIsModal, accessibilityViewIsModalBlock, accessibilityZoomInAtPoint, accessibilityZoomOutAtPoint, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, automationElements, automationElementsBlock, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hash, indexOfAccessibilityElement, isAccessibilityElement, isAccessibilityElementBlock, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivateBlock, setAccessibilityActivationPoint, setAccessibilityActivationPointBlock, setAccessibilityAttributedHint, setAccessibilityAttributedHintBlock, setAccessibilityAttributedLabel, setAccessibilityAttributedLabelBlock, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedUserInputLabelsBlock, setAccessibilityAttributedValue, setAccessibilityAttributedValueBlock, setAccessibilityContainerType, setAccessibilityContainerTypeBlock, setAccessibilityCustomActions, setAccessibilityCustomActionsBlock, setAccessibilityCustomRotors, setAccessibilityCustomRotorsBlock, setAccessibilityDecrementBlock, setAccessibilityDirectTouchOptions, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsBlock, setAccessibilityElementsHidden, setAccessibilityElementsHiddenBlock, setAccessibilityFrame, setAccessibilityFrameBlock, setAccessibilityHeaderElementsBlock, setAccessibilityHint, setAccessibilityHintBlock, setAccessibilityIdentifierBlock, setAccessibilityIncrementBlock, setAccessibilityLabel, setAccessibilityLabelBlock, setAccessibilityLanguage, setAccessibilityLanguageBlock, setAccessibilityMagicTapBlock, setAccessibilityNavigationStyle, setAccessibilityNavigationStyleBlock, setAccessibilityPath, setAccessibilityPathBlock, setAccessibilityPerformEscapeBlock, setAccessibilityRespondsToUserInteraction, setAccessibilityRespondsToUserInteractionBlock, setAccessibilityShouldGroupAccessibilityChildrenBlock, setAccessibilityTextualContext, setAccessibilityTextualContextBlock, setAccessibilityTraits, setAccessibilityTraitsBlock, setAccessibilityUserInputLabels, setAccessibilityUserInputLabelsBlock, setAccessibilityValue, setAccessibilityValueBlock, setAccessibilityViewIsModal, setAccessibilityViewIsModalBlock, setAutomationElements, setAutomationElementsBlock, setIsAccessibilityElement, setIsAccessibilityElementBlock, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, storedValueForKey, superclass, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, unableToSetNilForKey, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, valuesForKeys, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static SKPhysicsBody alloc()
-
allocWithZone
public static SKPhysicsBody allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(@NotNull @NotNull java.lang.String key)
-
bodyWithBodies
@NotNull public static @NotNull SKPhysicsBody bodyWithBodies(@NotNull @NotNull NSArray<? extends SKPhysicsBody> bodies)
Creates an compound body that is the union of the bodies used to create it.
-
bodyWithCircleOfRadius
@NotNull public static @NotNull SKPhysicsBody bodyWithCircleOfRadius(double r)
Creates a circle of radius r centered at the node's origin.- Parameters:
r- the radius in points
-
bodyWithCircleOfRadiusCenter
@NotNull public static @NotNull SKPhysicsBody bodyWithCircleOfRadiusCenter(double r, CGPoint center)
Creates a circle of radius r centered at a point in the node's coordinate space.- Parameters:
r- the radius in points
-
bodyWithEdgeChainFromPath
@NotNull public static @NotNull SKPhysicsBody bodyWithEdgeChainFromPath(@NotNull @NotNull CGPathRef path)
Creates an edge chain from a path. The path must have no self intersection. Edges have no volume and are intended to be used to create static environments. Edges can collide with bodies of volume, but not with each other.- Parameters:
path- the path to use
-
bodyWithEdgeFromPointToPoint
@NotNull public static @NotNull SKPhysicsBody bodyWithEdgeFromPointToPoint(CGPoint p1, CGPoint p2)
Creates an edge from p1 to p2. Edges have no volume and are intended to be used to create static environments. Edges can collide with bodies of volume, but not with each other.- Parameters:
p1- start pointp2- end point
-
bodyWithEdgeLoopFromPath
@NotNull public static @NotNull SKPhysicsBody bodyWithEdgeLoopFromPath(@NotNull @NotNull CGPathRef path)
Creates an edge loop from a path. A loop is automatically created by joining the last point to the first. The path must have no self intersection. Edges have no volume and are intended to be used to create static environments. Edges can collide with body's of volume, but not with each other.- Parameters:
path- the path to use
-
bodyWithEdgeLoopFromRect
@NotNull public static @NotNull SKPhysicsBody bodyWithEdgeLoopFromRect(CGRect rect)
Creates an edge loop from a CGRect. Edges have no volume and are intended to be used to create static environments. Edges can collide with body's of volume, but not with each other.- Parameters:
rect- the CGRect to use
-
bodyWithPolygonFromPath
@NotNull public static @NotNull SKPhysicsBody bodyWithPolygonFromPath(@NotNull @NotNull CGPathRef path)
The path must represent a convex or concave polygon with counter clockwise winding and no self intersection. Positions are relative to the node's origin.- Parameters:
path- the path to use
-
bodyWithRectangleOfSize
@NotNull public static @NotNull SKPhysicsBody bodyWithRectangleOfSize(CGSize s)
Creates a rectangle of the specified size centered at the node's origin.- Parameters:
s- the size in points
-
bodyWithRectangleOfSizeCenter
@NotNull public static @NotNull SKPhysicsBody bodyWithRectangleOfSizeCenter(CGSize s, CGPoint center)
Creates a rectangle of the specified size centered at a point in the node's coordinate space.- Parameters:
s- the size in points
-
bodyWithTextureAlphaThresholdSize
@NotNull public static @NotNull SKPhysicsBody bodyWithTextureAlphaThresholdSize(@NotNull @NotNull SKTexture texture, float alphaThreshold, CGSize size)
Creates a body from the alpha values in the supplied texture.- Parameters:
texture- the texture to be interpretedalphaThreshold- the alpha value above which a pixel is interpreted as opaquesize- of the generated physics body API-Since: 8.0
-
bodyWithTextureSize
@NotNull public static @NotNull SKPhysicsBody bodyWithTextureSize(@NotNull @NotNull SKTexture texture, CGSize size)
Creates a body from the alpha values in the supplied texture.- Parameters:
texture- the texture to be interpretedsize- of the generated physics body API-Since: 8.0
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(@NotNull @NotNull java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull @NotNull java.lang.Object aTarget, @NotNull @NotNull org.moe.natj.objc.SEL aSelector, @Nullable @Nullable java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
@NotNull public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
@NotNull public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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
@NotNull public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(@NotNull @NotNull java.lang.String key)
-
new_objc
public static SKPhysicsBody 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)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
affectedByGravity
public boolean affectedByGravity()
Bodies are affected by field forces such as gravity if this property is set and the field's category mask is set appropriately. The default value is YES. If this is set a force is applied to the object based on the mass. Set the field force vector in the scene to modify the strength of the force.
-
allContactedBodies
@NotNull public @NotNull NSArray<? extends SKPhysicsBody> allContactedBodies()
Returns an array of all SKPhysicsBodies currently in contact with this one
-
allowsRotation
public boolean allowsRotation()
-
angularDamping
public double angularDamping()
Optionally reduce the body's angular velocity each frame to simulate rotational friction. (0.0 - 1.0). Defaults to 0.1
-
angularVelocity
public double angularVelocity()
-
applyAngularImpulse
public void applyAngularImpulse(double impulse)
-
applyForce
public void applyForce(CGVector force)
-
applyImpulse
public void applyImpulse(CGVector impulse)
-
applyTorque
public void applyTorque(double torque)
-
area
public double area()
The area of the body. The unit is arbitrary, as long as the relative areas are consistent throughout the application.
-
categoryBitMask
public int categoryBitMask()
Defines what logical 'categories' this body belongs to. Defaults to all bits set (all categories).
-
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 API-Since: 8.0
-
collisionBitMask
public int collisionBitMask()
Defines what logical 'categories' of bodies this body responds to collisions with. Defaults to all bits set (all categories).
-
contactTestBitMask
public int contactTestBitMask()
Defines what logical 'categories' of bodies this body generates intersection notifications with. Defaults to all bits cleared (no categories).
-
copyWithZone
@NotNull public @NotNull java.lang.Object copyWithZone(@Nullable @Nullable org.moe.natj.general.ptr.VoidPtr zone)- Specified by:
copyWithZonein interfaceNSCopying
-
density
public double density()
The density of the body. The unit is arbitrary, as long as the relative densities are consistent throughout the application. Note that density and mass are inherently related (they are directly proportional), so changing one also changes the other. Both are provided so either can be used depending on what is more relevant to your usage.
-
encodeWithCoder
public void encodeWithCoder(@NotNull @NotNull NSCoder coder)- Specified by:
encodeWithCoderin interfaceNSCoding
-
fieldBitMask
public int fieldBitMask()
Defines what logical 'categories' of fields this body responds to. Defaults to all bits set (all categories). Can be forced off via affectedByGravity. API-Since: 8.0
-
friction
public double friction()
Determines the 'roughness' for the surface of the physics body (0.0 - 1.0). Defaults to 0.2
-
init
public SKPhysicsBody init()
-
initWithCoder
public SKPhysicsBody initWithCoder(@NotNull @NotNull NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
isDynamic
public boolean isDynamic()
-
setDynamic
public void setDynamic(boolean value)
-
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".
-
setResting
public void setResting(boolean value)
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".
-
joints
@NotNull public @NotNull NSArray<? extends SKPhysicsJoint> joints()
-
linearDamping
public double linearDamping()
Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1. Used in conjunction with per frame impulses, an object can be made to move at a constant speed. For example, if an object 64 points in size and default density and a linearDamping of 25 will slide across the screen in a few seconds if an impulse of magnitude 10 is applied every update.
-
mass
public double mass()
The mass of the body. The unit is arbitrary, as long as the relative masses are consistent throughout the application. Note that density and mass are inherently related (they are directly proportional), so changing one also changes the other. Both are provided so either can be used depending on what is more relevant to your usage.
-
node
@Nullable public @Nullable SKNode node()
The representedObject this physicsBody is currently bound to, or nil if it is not.
-
pinned
public boolean pinned()
API-Since: 8.0
-
restitution
public double restitution()
Determines the 'bounciness' of the physics body (0.0 - 1.0). Defaults to 0.2
-
setAffectedByGravity
public void setAffectedByGravity(boolean value)
Bodies are affected by field forces such as gravity if this property is set and the field's category mask is set appropriately. The default value is YES. If this is set a force is applied to the object based on the mass. Set the field force vector in the scene to modify the strength of the force.
-
setAllowsRotation
public void setAllowsRotation(boolean value)
-
setAngularDamping
public void setAngularDamping(double value)
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(double value)
-
setCategoryBitMask
public void setCategoryBitMask(int value)
Defines what logical 'categories' this body belongs to. Defaults to all bits set (all categories).
-
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 API-Since: 8.0
-
setCollisionBitMask
public void setCollisionBitMask(int value)
Defines what logical 'categories' of bodies this body responds to collisions with. Defaults to all bits set (all categories).
-
setContactTestBitMask
public void setContactTestBitMask(int value)
Defines what logical 'categories' of bodies this body generates intersection notifications with. Defaults to all bits cleared (no categories).
-
setDensity
public void setDensity(double value)
The density of the body. The unit is arbitrary, as long as the relative densities are consistent throughout the application. Note that density and mass are inherently related (they are directly proportional), so changing one also changes the other. Both are provided so either can be used depending on what is more relevant to your usage.
-
setFieldBitMask
public void setFieldBitMask(int value)
Defines what logical 'categories' of fields this body responds to. Defaults to all bits set (all categories). Can be forced off via affectedByGravity. API-Since: 8.0
-
setFriction
public void setFriction(double value)
Determines the 'roughness' for the surface of the physics body (0.0 - 1.0). Defaults to 0.2
-
setLinearDamping
public void setLinearDamping(double value)
Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1. Used in conjunction with per frame impulses, an object can be made to move at a constant speed. For example, if an object 64 points in size and default density and a linearDamping of 25 will slide across the screen in a few seconds if an impulse of magnitude 10 is applied every update.
-
setMass
public void setMass(double value)
The mass of the body. The unit is arbitrary, as long as the relative masses are consistent throughout the application. Note that density and mass are inherently related (they are directly proportional), so changing one also changes the other. Both are provided so either can be used depending on what is more relevant to your usage.
-
setPinned
public void setPinned(boolean value)
API-Since: 8.0
-
setRestitution
public void setRestitution(double value)
Determines the 'bounciness' of the physics body (0.0 - 1.0). Defaults to 0.2
-
setUsesPreciseCollisionDetection
public void setUsesPreciseCollisionDetection(boolean value)
-
setVelocity
public void setVelocity(CGVector value)
-
usesPreciseCollisionDetection
public boolean usesPreciseCollisionDetection()
-
velocity
public CGVector velocity()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis 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:
_supportsSecureCodingin interfaceNSSecureCoding
-
useStoredAccessor
@Deprecated public static boolean useStoredAccessor()
Deprecated.
-
-