1 /** 2 Server interface for low-level physics access. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.physicsserver; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.physicsdirectbodystate; 24 import godot.physicsdirectspacestate; 25 /** 26 Server interface for low-level physics access. 27 28 PhysicsServer is the server responsible for all 3D physics. It can create many kinds of physics objects, but does not insert them on the node tree. 29 */ 30 @GodotBaseClass struct PhysicsServerSingleton 31 { 32 package(godot) enum string _GODOT_internal_name = "PhysicsServer"; 33 public: 34 @nogc nothrow: 35 union { /** */ godot_object _godot_object; /** */ GodotObject _GODOT_base; } 36 alias _GODOT_base this; 37 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 38 package(godot) __gshared bool _classBindingInitialized = false; 39 package(godot) static struct GDNativeClassBinding 40 { 41 __gshared: 42 godot_object _singleton; 43 immutable char* _singletonName = "PhysicsServer"; 44 @GodotName("area_add_shape") GodotMethod!(void, RID, RID, Transform, bool) areaAddShape; 45 @GodotName("area_attach_object_instance_id") GodotMethod!(void, RID, long) areaAttachObjectInstanceId; 46 @GodotName("area_clear_shapes") GodotMethod!(void, RID) areaClearShapes; 47 @GodotName("area_create") GodotMethod!(RID) areaCreate; 48 @GodotName("area_get_object_instance_id") GodotMethod!(long, RID) areaGetObjectInstanceId; 49 @GodotName("area_get_param") GodotMethod!(Variant, RID, long) areaGetParam; 50 @GodotName("area_get_shape") GodotMethod!(RID, RID, long) areaGetShape; 51 @GodotName("area_get_shape_count") GodotMethod!(long, RID) areaGetShapeCount; 52 @GodotName("area_get_shape_transform") GodotMethod!(Transform, RID, long) areaGetShapeTransform; 53 @GodotName("area_get_space") GodotMethod!(RID, RID) areaGetSpace; 54 @GodotName("area_get_space_override_mode") GodotMethod!(PhysicsServer.AreaSpaceOverrideMode, RID) areaGetSpaceOverrideMode; 55 @GodotName("area_get_transform") GodotMethod!(Transform, RID) areaGetTransform; 56 @GodotName("area_is_ray_pickable") GodotMethod!(bool, RID) areaIsRayPickable; 57 @GodotName("area_remove_shape") GodotMethod!(void, RID, long) areaRemoveShape; 58 @GodotName("area_set_area_monitor_callback") GodotMethod!(void, RID, GodotObject, String) areaSetAreaMonitorCallback; 59 @GodotName("area_set_collision_layer") GodotMethod!(void, RID, long) areaSetCollisionLayer; 60 @GodotName("area_set_collision_mask") GodotMethod!(void, RID, long) areaSetCollisionMask; 61 @GodotName("area_set_monitor_callback") GodotMethod!(void, RID, GodotObject, String) areaSetMonitorCallback; 62 @GodotName("area_set_monitorable") GodotMethod!(void, RID, bool) areaSetMonitorable; 63 @GodotName("area_set_param") GodotMethod!(void, RID, long, Variant) areaSetParam; 64 @GodotName("area_set_ray_pickable") GodotMethod!(void, RID, bool) areaSetRayPickable; 65 @GodotName("area_set_shape") GodotMethod!(void, RID, long, RID) areaSetShape; 66 @GodotName("area_set_shape_disabled") GodotMethod!(void, RID, long, bool) areaSetShapeDisabled; 67 @GodotName("area_set_shape_transform") GodotMethod!(void, RID, long, Transform) areaSetShapeTransform; 68 @GodotName("area_set_space") GodotMethod!(void, RID, RID) areaSetSpace; 69 @GodotName("area_set_space_override_mode") GodotMethod!(void, RID, long) areaSetSpaceOverrideMode; 70 @GodotName("area_set_transform") GodotMethod!(void, RID, Transform) areaSetTransform; 71 @GodotName("body_add_central_force") GodotMethod!(void, RID, Vector3) bodyAddCentralForce; 72 @GodotName("body_add_collision_exception") GodotMethod!(void, RID, RID) bodyAddCollisionException; 73 @GodotName("body_add_force") GodotMethod!(void, RID, Vector3, Vector3) bodyAddForce; 74 @GodotName("body_add_shape") GodotMethod!(void, RID, RID, Transform, bool) bodyAddShape; 75 @GodotName("body_add_torque") GodotMethod!(void, RID, Vector3) bodyAddTorque; 76 @GodotName("body_apply_central_impulse") GodotMethod!(void, RID, Vector3) bodyApplyCentralImpulse; 77 @GodotName("body_apply_impulse") GodotMethod!(void, RID, Vector3, Vector3) bodyApplyImpulse; 78 @GodotName("body_apply_torque_impulse") GodotMethod!(void, RID, Vector3) bodyApplyTorqueImpulse; 79 @GodotName("body_attach_object_instance_id") GodotMethod!(void, RID, long) bodyAttachObjectInstanceId; 80 @GodotName("body_clear_shapes") GodotMethod!(void, RID) bodyClearShapes; 81 @GodotName("body_create") GodotMethod!(RID, long, bool) bodyCreate; 82 @GodotName("body_get_collision_layer") GodotMethod!(long, RID) bodyGetCollisionLayer; 83 @GodotName("body_get_collision_mask") GodotMethod!(long, RID) bodyGetCollisionMask; 84 @GodotName("body_get_direct_state") GodotMethod!(PhysicsDirectBodyState, RID) bodyGetDirectState; 85 @GodotName("body_get_kinematic_safe_margin") GodotMethod!(double, RID) bodyGetKinematicSafeMargin; 86 @GodotName("body_get_max_contacts_reported") GodotMethod!(long, RID) bodyGetMaxContactsReported; 87 @GodotName("body_get_mode") GodotMethod!(PhysicsServer.BodyMode, RID) bodyGetMode; 88 @GodotName("body_get_object_instance_id") GodotMethod!(long, RID) bodyGetObjectInstanceId; 89 @GodotName("body_get_param") GodotMethod!(double, RID, long) bodyGetParam; 90 @GodotName("body_get_shape") GodotMethod!(RID, RID, long) bodyGetShape; 91 @GodotName("body_get_shape_count") GodotMethod!(long, RID) bodyGetShapeCount; 92 @GodotName("body_get_shape_transform") GodotMethod!(Transform, RID, long) bodyGetShapeTransform; 93 @GodotName("body_get_space") GodotMethod!(RID, RID) bodyGetSpace; 94 @GodotName("body_get_state") GodotMethod!(Variant, RID, long) bodyGetState; 95 @GodotName("body_is_axis_locked") GodotMethod!(bool, RID, long) bodyIsAxisLocked; 96 @GodotName("body_is_continuous_collision_detection_enabled") GodotMethod!(bool, RID) bodyIsContinuousCollisionDetectionEnabled; 97 @GodotName("body_is_omitting_force_integration") GodotMethod!(bool, RID) bodyIsOmittingForceIntegration; 98 @GodotName("body_is_ray_pickable") GodotMethod!(bool, RID) bodyIsRayPickable; 99 @GodotName("body_remove_collision_exception") GodotMethod!(void, RID, RID) bodyRemoveCollisionException; 100 @GodotName("body_remove_shape") GodotMethod!(void, RID, long) bodyRemoveShape; 101 @GodotName("body_set_axis_lock") GodotMethod!(void, RID, long, bool) bodySetAxisLock; 102 @GodotName("body_set_axis_velocity") GodotMethod!(void, RID, Vector3) bodySetAxisVelocity; 103 @GodotName("body_set_collision_layer") GodotMethod!(void, RID, long) bodySetCollisionLayer; 104 @GodotName("body_set_collision_mask") GodotMethod!(void, RID, long) bodySetCollisionMask; 105 @GodotName("body_set_enable_continuous_collision_detection") GodotMethod!(void, RID, bool) bodySetEnableContinuousCollisionDetection; 106 @GodotName("body_set_force_integration_callback") GodotMethod!(void, RID, GodotObject, String, Variant) bodySetForceIntegrationCallback; 107 @GodotName("body_set_kinematic_safe_margin") GodotMethod!(void, RID, double) bodySetKinematicSafeMargin; 108 @GodotName("body_set_max_contacts_reported") GodotMethod!(void, RID, long) bodySetMaxContactsReported; 109 @GodotName("body_set_mode") GodotMethod!(void, RID, long) bodySetMode; 110 @GodotName("body_set_omit_force_integration") GodotMethod!(void, RID, bool) bodySetOmitForceIntegration; 111 @GodotName("body_set_param") GodotMethod!(void, RID, long, double) bodySetParam; 112 @GodotName("body_set_ray_pickable") GodotMethod!(void, RID, bool) bodySetRayPickable; 113 @GodotName("body_set_shape") GodotMethod!(void, RID, long, RID) bodySetShape; 114 @GodotName("body_set_shape_disabled") GodotMethod!(void, RID, long, bool) bodySetShapeDisabled; 115 @GodotName("body_set_shape_transform") GodotMethod!(void, RID, long, Transform) bodySetShapeTransform; 116 @GodotName("body_set_space") GodotMethod!(void, RID, RID) bodySetSpace; 117 @GodotName("body_set_state") GodotMethod!(void, RID, long, Variant) bodySetState; 118 @GodotName("cone_twist_joint_get_param") GodotMethod!(double, RID, long) coneTwistJointGetParam; 119 @GodotName("cone_twist_joint_set_param") GodotMethod!(void, RID, long, double) coneTwistJointSetParam; 120 @GodotName("free_rid") GodotMethod!(void, RID) freeRid; 121 @GodotName("generic_6dof_joint_get_flag") GodotMethod!(bool, RID, long, long) generic6dofJointGetFlag; 122 @GodotName("generic_6dof_joint_get_param") GodotMethod!(double, RID, long, long) generic6dofJointGetParam; 123 @GodotName("generic_6dof_joint_set_flag") GodotMethod!(void, RID, long, long, bool) generic6dofJointSetFlag; 124 @GodotName("generic_6dof_joint_set_param") GodotMethod!(void, RID, long, long, double) generic6dofJointSetParam; 125 @GodotName("get_process_info") GodotMethod!(long, long) getProcessInfo; 126 @GodotName("hinge_joint_get_flag") GodotMethod!(bool, RID, long) hingeJointGetFlag; 127 @GodotName("hinge_joint_get_param") GodotMethod!(double, RID, long) hingeJointGetParam; 128 @GodotName("hinge_joint_set_flag") GodotMethod!(void, RID, long, bool) hingeJointSetFlag; 129 @GodotName("hinge_joint_set_param") GodotMethod!(void, RID, long, double) hingeJointSetParam; 130 @GodotName("joint_create_cone_twist") GodotMethod!(RID, RID, Transform, RID, Transform) jointCreateConeTwist; 131 @GodotName("joint_create_generic_6dof") GodotMethod!(RID, RID, Transform, RID, Transform) jointCreateGeneric6dof; 132 @GodotName("joint_create_hinge") GodotMethod!(RID, RID, Transform, RID, Transform) jointCreateHinge; 133 @GodotName("joint_create_pin") GodotMethod!(RID, RID, Vector3, RID, Vector3) jointCreatePin; 134 @GodotName("joint_create_slider") GodotMethod!(RID, RID, Transform, RID, Transform) jointCreateSlider; 135 @GodotName("joint_get_solver_priority") GodotMethod!(long, RID) jointGetSolverPriority; 136 @GodotName("joint_get_type") GodotMethod!(PhysicsServer.JointType, RID) jointGetType; 137 @GodotName("joint_set_solver_priority") GodotMethod!(void, RID, long) jointSetSolverPriority; 138 @GodotName("pin_joint_get_local_a") GodotMethod!(Vector3, RID) pinJointGetLocalA; 139 @GodotName("pin_joint_get_local_b") GodotMethod!(Vector3, RID) pinJointGetLocalB; 140 @GodotName("pin_joint_get_param") GodotMethod!(double, RID, long) pinJointGetParam; 141 @GodotName("pin_joint_set_local_a") GodotMethod!(void, RID, Vector3) pinJointSetLocalA; 142 @GodotName("pin_joint_set_local_b") GodotMethod!(void, RID, Vector3) pinJointSetLocalB; 143 @GodotName("pin_joint_set_param") GodotMethod!(void, RID, long, double) pinJointSetParam; 144 @GodotName("set_active") GodotMethod!(void, bool) setActive; 145 @GodotName("shape_create") GodotMethod!(RID, long) shapeCreate; 146 @GodotName("shape_get_data") GodotMethod!(Variant, RID) shapeGetData; 147 @GodotName("shape_get_type") GodotMethod!(PhysicsServer.ShapeType, RID) shapeGetType; 148 @GodotName("shape_set_data") GodotMethod!(void, RID, Variant) shapeSetData; 149 @GodotName("slider_joint_get_param") GodotMethod!(double, RID, long) sliderJointGetParam; 150 @GodotName("slider_joint_set_param") GodotMethod!(void, RID, long, double) sliderJointSetParam; 151 @GodotName("space_create") GodotMethod!(RID) spaceCreate; 152 @GodotName("space_get_direct_state") GodotMethod!(PhysicsDirectSpaceState, RID) spaceGetDirectState; 153 @GodotName("space_get_param") GodotMethod!(double, RID, long) spaceGetParam; 154 @GodotName("space_is_active") GodotMethod!(bool, RID) spaceIsActive; 155 @GodotName("space_set_active") GodotMethod!(void, RID, bool) spaceSetActive; 156 @GodotName("space_set_param") GodotMethod!(void, RID, long, double) spaceSetParam; 157 } 158 /// 159 pragma(inline, true) bool opEquals(in PhysicsServerSingleton other) const 160 { return _godot_object.ptr is other._godot_object.ptr; } 161 /// 162 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 163 { _godot_object.ptr = n; return null; } 164 /// 165 pragma(inline, true) bool opEquals(typeof(null) n) const 166 { return _godot_object.ptr is n; } 167 /// 168 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 169 mixin baseCasts; 170 /// Construct a new instance of PhysicsServerSingleton. 171 /// Note: use `memnew!PhysicsServerSingleton` instead. 172 static PhysicsServerSingleton _new() 173 { 174 static godot_class_constructor constructor; 175 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("PhysicsServer"); 176 if(constructor is null) return typeof(this).init; 177 return cast(PhysicsServerSingleton)(constructor()); 178 } 179 @disable new(size_t s); 180 /// 181 enum BodyAxis : int 182 { 183 /** 184 185 */ 186 bodyAxisLinearX = 1, 187 /** 188 189 */ 190 bodyAxisLinearY = 2, 191 /** 192 193 */ 194 bodyAxisLinearZ = 4, 195 /** 196 197 */ 198 bodyAxisAngularX = 8, 199 /** 200 201 */ 202 bodyAxisAngularY = 16, 203 /** 204 205 */ 206 bodyAxisAngularZ = 32, 207 } 208 /// 209 enum ProcessInfo : int 210 { 211 /** 212 Constant to get the number of objects that are not sleeping. 213 */ 214 infoActiveObjects = 0, 215 /** 216 Constant to get the number of possible collisions. 217 */ 218 infoCollisionPairs = 1, 219 /** 220 Constant to get the number of space regions where a collision could occur. 221 */ 222 infoIslandCount = 2, 223 } 224 /// 225 enum AreaBodyStatus : int 226 { 227 /** 228 The value of the first parameter and area callback function receives, when an object enters one of its shapes. 229 */ 230 areaBodyAdded = 0, 231 /** 232 The value of the first parameter and area callback function receives, when an object exits one of its shapes. 233 */ 234 areaBodyRemoved = 1, 235 } 236 /// 237 enum BodyMode : int 238 { 239 /** 240 Constant for static bodies. 241 */ 242 bodyModeStatic = 0, 243 /** 244 Constant for kinematic bodies. 245 */ 246 bodyModeKinematic = 1, 247 /** 248 Constant for rigid bodies. 249 */ 250 bodyModeRigid = 2, 251 /** 252 Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. 253 */ 254 bodyModeCharacter = 3, 255 } 256 /// 257 enum ShapeType : int 258 { 259 /** 260 The $(D Shape) is a $(D PlaneShape). 261 */ 262 shapePlane = 0, 263 /** 264 The $(D Shape) is a $(D RayShape). 265 */ 266 shapeRay = 1, 267 /** 268 The $(D Shape) is a $(D SphereShape). 269 */ 270 shapeSphere = 2, 271 /** 272 The $(D Shape) is a $(D BoxShape). 273 */ 274 shapeBox = 3, 275 /** 276 The $(D Shape) is a $(D CapsuleShape). 277 */ 278 shapeCapsule = 4, 279 /** 280 The $(D Shape) is a $(D CylinderShape). 281 */ 282 shapeCylinder = 5, 283 /** 284 The $(D Shape) is a $(D ConvexPolygonShape). 285 */ 286 shapeConvexPolygon = 6, 287 /** 288 The $(D Shape) is a $(D ConcavePolygonShape). 289 */ 290 shapeConcavePolygon = 7, 291 /** 292 The $(D Shape) is a $(D HeightMapShape). 293 */ 294 shapeHeightmap = 8, 295 /** 296 This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. 297 */ 298 shapeCustom = 9, 299 } 300 /// 301 enum PinJointParam : int 302 { 303 /** 304 The strength with which the pinned objects try to stay in positional relation to each other. 305 The higher, the stronger. 306 */ 307 pinJointBias = 0, 308 /** 309 The strength with which the pinned objects try to stay in velocity relation to each other. 310 The higher, the stronger. 311 */ 312 pinJointDamping = 1, 313 /** 314 If above 0, this value is the maximum value for an impulse that this Joint puts on its ends. 315 */ 316 pinJointImpulseClamp = 2, 317 } 318 /// 319 enum SpaceParameter : int 320 { 321 /** 322 Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. 323 */ 324 spaceParamContactRecycleRadius = 0, 325 /** 326 Constant to set/get the maximum distance a shape can be from another before they are considered separated. 327 */ 328 spaceParamContactMaxSeparation = 1, 329 /** 330 Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. 331 */ 332 spaceParamBodyMaxAllowedPenetration = 2, 333 /** 334 Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. 335 */ 336 spaceParamBodyLinearVelocitySleepThreshold = 3, 337 /** 338 Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. 339 */ 340 spaceParamBodyAngularVelocitySleepThreshold = 4, 341 /** 342 Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. 343 */ 344 spaceParamBodyTimeToSleep = 5, 345 /** 346 347 */ 348 spaceParamBodyAngularVelocityDampRatio = 6, 349 /** 350 Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. 351 */ 352 spaceParamConstraintDefaultBias = 7, 353 /** 354 355 */ 356 spaceParamTestMotionMinContactDepth = 8, 357 } 358 /// 359 enum ConeTwistJointParam : int 360 { 361 /** 362 Swing is rotation from side to side, around the axis perpendicular to the twist axis. 363 The swing span defines, how much rotation will not get corrected along the swing axis. 364 Could be defined as looseness in the $(D ConeTwistJoint). 365 If below 0.05, this behavior is locked. 366 */ 367 coneTwistJointSwingSpan = 0, 368 /** 369 Twist is the rotation around the twist axis, this value defined how far the joint can twist. 370 Twist is locked if below 0.05. 371 */ 372 coneTwistJointTwistSpan = 1, 373 /** 374 The speed with which the swing or twist will take place. 375 The higher, the faster. 376 */ 377 coneTwistJointBias = 2, 378 /** 379 The ease with which the Joint twists, if it's too low, it takes more force to twist the joint. 380 */ 381 coneTwistJointSoftness = 3, 382 /** 383 Defines, how fast the swing- and twist-speed-difference on both sides gets synced. 384 */ 385 coneTwistJointRelaxation = 4, 386 } 387 /// 388 enum JointType : int 389 { 390 /** 391 The $(D Joint) is a $(D PinJoint). 392 */ 393 jointPin = 0, 394 /** 395 The $(D Joint) is a $(D HingeJoint). 396 */ 397 jointHinge = 1, 398 /** 399 The $(D Joint) is a $(D SliderJoint). 400 */ 401 jointSlider = 2, 402 /** 403 The $(D Joint) is a $(D ConeTwistJoint). 404 */ 405 jointConeTwist = 3, 406 /** 407 The $(D Joint) is a $(D Generic6DOFJoint). 408 */ 409 joint6dof = 4, 410 } 411 /// 412 enum BodyState : int 413 { 414 /** 415 Constant to set/get the current transform matrix of the body. 416 */ 417 bodyStateTransform = 0, 418 /** 419 Constant to set/get the current linear velocity of the body. 420 */ 421 bodyStateLinearVelocity = 1, 422 /** 423 Constant to set/get the current angular velocity of the body. 424 */ 425 bodyStateAngularVelocity = 2, 426 /** 427 Constant to sleep/wake up a body, or to get whether it is sleeping. 428 */ 429 bodyStateSleeping = 3, 430 /** 431 Constant to set/get whether the body can sleep. 432 */ 433 bodyStateCanSleep = 4, 434 } 435 /// 436 enum BodyParameter : int 437 { 438 /** 439 Constant to set/get a body's bounce factor. 440 */ 441 bodyParamBounce = 0, 442 /** 443 Constant to set/get a body's friction. 444 */ 445 bodyParamFriction = 1, 446 /** 447 Constant to set/get a body's mass. 448 */ 449 bodyParamMass = 2, 450 /** 451 Constant to set/get a body's gravity multiplier. 452 */ 453 bodyParamGravityScale = 3, 454 /** 455 Constant to set/get a body's linear dampening factor. 456 */ 457 bodyParamLinearDamp = 4, 458 /** 459 Constant to set/get a body's angular dampening factor. 460 */ 461 bodyParamAngularDamp = 5, 462 /** 463 Represents the size of the $(D bodyparameter) enum. 464 */ 465 bodyParamMax = 6, 466 } 467 /// 468 enum G6DOFJointAxisParam : int 469 { 470 /** 471 The minimum difference between the pivot points' axes. 472 */ 473 g6dofJointLinearLowerLimit = 0, 474 /** 475 The maximum difference between the pivot points' axes. 476 */ 477 g6dofJointLinearUpperLimit = 1, 478 /** 479 A factor that gets applied to the movement across the axes. The lower, the slower the movement. 480 */ 481 g6dofJointLinearLimitSoftness = 2, 482 /** 483 The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. 484 */ 485 g6dofJointLinearRestitution = 3, 486 /** 487 The amount of damping that happens at the linear motion across the axes. 488 */ 489 g6dofJointLinearDamping = 4, 490 /** 491 The velocity that the joint's linear motor will attempt to reach. 492 */ 493 g6dofJointLinearMotorTargetVelocity = 5, 494 /** 495 The maximum force that the linear motor can apply while trying to reach the target velocity. 496 */ 497 g6dofJointLinearMotorForceLimit = 6, 498 /** 499 The minimum rotation in negative direction to break loose and rotate around the axes. 500 */ 501 g6dofJointAngularLowerLimit = 10, 502 /** 503 The minimum rotation in positive direction to break loose and rotate around the axes. 504 */ 505 g6dofJointAngularUpperLimit = 11, 506 /** 507 A factor that gets multiplied onto all rotations across the axes. 508 */ 509 g6dofJointAngularLimitSoftness = 12, 510 /** 511 The amount of rotational damping across the axes. The lower, the more dampening occurs. 512 */ 513 g6dofJointAngularDamping = 13, 514 /** 515 The amount of rotational restitution across the axes. The lower, the more restitution occurs. 516 */ 517 g6dofJointAngularRestitution = 14, 518 /** 519 The maximum amount of force that can occur, when rotating around the axes. 520 */ 521 g6dofJointAngularForceLimit = 15, 522 /** 523 When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. 524 */ 525 g6dofJointAngularErp = 16, 526 /** 527 Target speed for the motor at the axes. 528 */ 529 g6dofJointAngularMotorTargetVelocity = 17, 530 /** 531 Maximum acceleration for the motor at the axes. 532 */ 533 g6dofJointAngularMotorForceLimit = 18, 534 } 535 /// 536 enum SliderJointParam : int 537 { 538 /** 539 The maximum difference between the pivot points on their X axis before damping happens. 540 */ 541 sliderJointLinearLimitUpper = 0, 542 /** 543 The minimum difference between the pivot points on their X axis before damping happens. 544 */ 545 sliderJointLinearLimitLower = 1, 546 /** 547 A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. 548 */ 549 sliderJointLinearLimitSoftness = 2, 550 /** 551 The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. 552 */ 553 sliderJointLinearLimitRestitution = 3, 554 /** 555 The amount of damping once the slider limits are surpassed. 556 */ 557 sliderJointLinearLimitDamping = 4, 558 /** 559 A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. 560 */ 561 sliderJointLinearMotionSoftness = 5, 562 /** 563 The amount of restitution inside the slider limits. 564 */ 565 sliderJointLinearMotionRestitution = 6, 566 /** 567 The amount of damping inside the slider limits. 568 */ 569 sliderJointLinearMotionDamping = 7, 570 /** 571 A factor applied to the movement across axes orthogonal to the slider. 572 */ 573 sliderJointLinearOrthogonalSoftness = 8, 574 /** 575 The amount of restitution when movement is across axes orthogonal to the slider. 576 */ 577 sliderJointLinearOrthogonalRestitution = 9, 578 /** 579 The amount of damping when movement is across axes orthogonal to the slider. 580 */ 581 sliderJointLinearOrthogonalDamping = 10, 582 /** 583 The upper limit of rotation in the slider. 584 */ 585 sliderJointAngularLimitUpper = 11, 586 /** 587 The lower limit of rotation in the slider. 588 */ 589 sliderJointAngularLimitLower = 12, 590 /** 591 A factor applied to the all rotation once the limit is surpassed. 592 */ 593 sliderJointAngularLimitSoftness = 13, 594 /** 595 The amount of restitution of the rotation when the limit is surpassed. 596 */ 597 sliderJointAngularLimitRestitution = 14, 598 /** 599 The amount of damping of the rotation when the limit is surpassed. 600 */ 601 sliderJointAngularLimitDamping = 15, 602 /** 603 A factor that gets applied to the all rotation in the limits. 604 */ 605 sliderJointAngularMotionSoftness = 16, 606 /** 607 The amount of restitution of the rotation in the limits. 608 */ 609 sliderJointAngularMotionRestitution = 17, 610 /** 611 The amount of damping of the rotation in the limits. 612 */ 613 sliderJointAngularMotionDamping = 18, 614 /** 615 A factor that gets applied to the all rotation across axes orthogonal to the slider. 616 */ 617 sliderJointAngularOrthogonalSoftness = 19, 618 /** 619 The amount of restitution of the rotation across axes orthogonal to the slider. 620 */ 621 sliderJointAngularOrthogonalRestitution = 20, 622 /** 623 The amount of damping of the rotation across axes orthogonal to the slider. 624 */ 625 sliderJointAngularOrthogonalDamping = 21, 626 /** 627 Represents the size of the $(D sliderjointparam) enum. 628 */ 629 sliderJointMax = 22, 630 } 631 /// 632 enum HingeJointParam : int 633 { 634 /** 635 The speed with which the two bodies get pulled together when they move in different directions. 636 */ 637 hingeJointBias = 0, 638 /** 639 The maximum rotation across the Hinge. 640 */ 641 hingeJointLimitUpper = 1, 642 /** 643 The minimum rotation across the Hinge. 644 */ 645 hingeJointLimitLower = 2, 646 /** 647 The speed with which the rotation across the axis perpendicular to the hinge gets corrected. 648 */ 649 hingeJointLimitBias = 3, 650 /** 651 652 */ 653 hingeJointLimitSoftness = 4, 654 /** 655 The lower this value, the more the rotation gets slowed down. 656 */ 657 hingeJointLimitRelaxation = 5, 658 /** 659 Target speed for the motor. 660 */ 661 hingeJointMotorTargetVelocity = 6, 662 /** 663 Maximum acceleration for the motor. 664 */ 665 hingeJointMotorMaxImpulse = 7, 666 } 667 /// 668 enum G6DOFJointAxisFlag : int 669 { 670 /** 671 If `set` there is linear motion possible within the given limits. 672 */ 673 g6dofJointFlagEnableLinearLimit = 0, 674 /** 675 If `set` there is rotational motion possible. 676 */ 677 g6dofJointFlagEnableAngularLimit = 1, 678 /** 679 If `set` there is a rotational motor across these axes. 680 */ 681 g6dofJointFlagEnableMotor = 4, 682 /** 683 If `set` there is a linear motor on this axis that targets a specific velocity. 684 */ 685 g6dofJointFlagEnableLinearMotor = 5, 686 } 687 /// 688 enum HingeJointFlag : int 689 { 690 /** 691 If `true`, the Hinge has a maximum and a minimum rotation. 692 */ 693 hingeJointFlagUseLimit = 0, 694 /** 695 If `true`, a motor turns the Hinge. 696 */ 697 hingeJointFlagEnableMotor = 1, 698 } 699 /// 700 enum AreaSpaceOverrideMode : int 701 { 702 /** 703 This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. 704 */ 705 areaSpaceOverrideDisabled = 0, 706 /** 707 This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. 708 */ 709 areaSpaceOverrideCombine = 1, 710 /** 711 This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. 712 */ 713 areaSpaceOverrideCombineReplace = 2, 714 /** 715 This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. 716 */ 717 areaSpaceOverrideReplace = 3, 718 /** 719 This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. 720 */ 721 areaSpaceOverrideReplaceCombine = 4, 722 } 723 /// 724 enum AreaParameter : int 725 { 726 /** 727 Constant to set/get gravity strength in an area. 728 */ 729 areaParamGravity = 0, 730 /** 731 Constant to set/get gravity vector/center in an area. 732 */ 733 areaParamGravityVector = 1, 734 /** 735 Constant to set/get whether the gravity vector of an area is a direction, or a center point. 736 */ 737 areaParamGravityIsPoint = 2, 738 /** 739 Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. 740 */ 741 areaParamGravityDistanceScale = 3, 742 /** 743 This constant was used to set/get the falloff factor for point gravity. It has been superseded by $(D constant AREA_PARAM_GRAVITY_DISTANCE_SCALE). 744 */ 745 areaParamGravityPointAttenuation = 4, 746 /** 747 Constant to set/get the linear dampening factor of an area. 748 */ 749 areaParamLinearDamp = 5, 750 /** 751 Constant to set/get the angular dampening factor of an area. 752 */ 753 areaParamAngularDamp = 6, 754 /** 755 Constant to set/get the priority (order of processing) of an area. 756 */ 757 areaParamPriority = 7, 758 } 759 /// 760 enum Constants : int 761 { 762 infoActiveObjects = 0, 763 sliderJointLinearLimitUpper = 0, 764 hingeJointBias = 0, 765 g6dofJointLinearLowerLimit = 0, 766 jointPin = 0, 767 areaSpaceOverrideDisabled = 0, 768 shapePlane = 0, 769 bodyStateTransform = 0, 770 bodyParamBounce = 0, 771 coneTwistJointSwingSpan = 0, 772 hingeJointFlagUseLimit = 0, 773 areaParamGravity = 0, 774 pinJointBias = 0, 775 bodyModeStatic = 0, 776 g6dofJointFlagEnableLinearLimit = 0, 777 spaceParamContactRecycleRadius = 0, 778 areaBodyAdded = 0, 779 spaceParamContactMaxSeparation = 1, 780 hingeJointFlagEnableMotor = 1, 781 bodyModeKinematic = 1, 782 g6dofJointFlagEnableAngularLimit = 1, 783 bodyParamFriction = 1, 784 coneTwistJointTwistSpan = 1, 785 bodyAxisLinearX = 1, 786 bodyStateLinearVelocity = 1, 787 areaSpaceOverrideCombine = 1, 788 jointHinge = 1, 789 shapeRay = 1, 790 hingeJointLimitUpper = 1, 791 pinJointDamping = 1, 792 areaParamGravityVector = 1, 793 sliderJointLinearLimitLower = 1, 794 infoCollisionPairs = 1, 795 g6dofJointLinearUpperLimit = 1, 796 areaBodyRemoved = 1, 797 coneTwistJointBias = 2, 798 bodyStateAngularVelocity = 2, 799 bodyModeRigid = 2, 800 areaParamGravityIsPoint = 2, 801 jointSlider = 2, 802 g6dofJointLinearLimitSoftness = 2, 803 hingeJointLimitLower = 2, 804 pinJointImpulseClamp = 2, 805 sliderJointLinearLimitSoftness = 2, 806 areaSpaceOverrideCombineReplace = 2, 807 bodyAxisLinearY = 2, 808 bodyParamMass = 2, 809 shapeSphere = 2, 810 infoIslandCount = 2, 811 spaceParamBodyMaxAllowedPenetration = 2, 812 hingeJointLimitBias = 3, 813 bodyStateSleeping = 3, 814 coneTwistJointSoftness = 3, 815 areaSpaceOverrideReplace = 3, 816 areaParamGravityDistanceScale = 3, 817 sliderJointLinearLimitRestitution = 3, 818 g6dofJointLinearRestitution = 3, 819 bodyParamGravityScale = 3, 820 spaceParamBodyLinearVelocitySleepThreshold = 3, 821 bodyModeCharacter = 3, 822 jointConeTwist = 3, 823 shapeBox = 3, 824 sliderJointLinearLimitDamping = 4, 825 bodyAxisLinearZ = 4, 826 joint6dof = 4, 827 hingeJointLimitSoftness = 4, 828 g6dofJointLinearDamping = 4, 829 shapeCapsule = 4, 830 areaParamGravityPointAttenuation = 4, 831 spaceParamBodyAngularVelocitySleepThreshold = 4, 832 g6dofJointFlagEnableMotor = 4, 833 bodyParamLinearDamp = 4, 834 areaSpaceOverrideReplaceCombine = 4, 835 coneTwistJointRelaxation = 4, 836 bodyStateCanSleep = 4, 837 areaParamLinearDamp = 5, 838 shapeCylinder = 5, 839 sliderJointLinearMotionSoftness = 5, 840 spaceParamBodyTimeToSleep = 5, 841 g6dofJointLinearMotorTargetVelocity = 5, 842 bodyParamAngularDamp = 5, 843 g6dofJointFlagEnableLinearMotor = 5, 844 hingeJointLimitRelaxation = 5, 845 shapeConvexPolygon = 6, 846 bodyParamMax = 6, 847 g6dofJointLinearMotorForceLimit = 6, 848 sliderJointLinearMotionRestitution = 6, 849 areaParamAngularDamp = 6, 850 spaceParamBodyAngularVelocityDampRatio = 6, 851 hingeJointMotorTargetVelocity = 6, 852 shapeConcavePolygon = 7, 853 hingeJointMotorMaxImpulse = 7, 854 areaParamPriority = 7, 855 spaceParamConstraintDefaultBias = 7, 856 sliderJointLinearMotionDamping = 7, 857 shapeHeightmap = 8, 858 sliderJointLinearOrthogonalSoftness = 8, 859 bodyAxisAngularX = 8, 860 spaceParamTestMotionMinContactDepth = 8, 861 sliderJointLinearOrthogonalRestitution = 9, 862 shapeCustom = 9, 863 sliderJointLinearOrthogonalDamping = 10, 864 g6dofJointAngularLowerLimit = 10, 865 sliderJointAngularLimitUpper = 11, 866 g6dofJointAngularUpperLimit = 11, 867 sliderJointAngularLimitLower = 12, 868 g6dofJointAngularLimitSoftness = 12, 869 g6dofJointAngularDamping = 13, 870 sliderJointAngularLimitSoftness = 13, 871 g6dofJointAngularRestitution = 14, 872 sliderJointAngularLimitRestitution = 14, 873 sliderJointAngularLimitDamping = 15, 874 g6dofJointAngularForceLimit = 15, 875 bodyAxisAngularY = 16, 876 g6dofJointAngularErp = 16, 877 sliderJointAngularMotionSoftness = 16, 878 sliderJointAngularMotionRestitution = 17, 879 g6dofJointAngularMotorTargetVelocity = 17, 880 sliderJointAngularMotionDamping = 18, 881 g6dofJointAngularMotorForceLimit = 18, 882 sliderJointAngularOrthogonalSoftness = 19, 883 sliderJointAngularOrthogonalRestitution = 20, 884 sliderJointAngularOrthogonalDamping = 21, 885 sliderJointMax = 22, 886 bodyAxisAngularZ = 32, 887 } 888 /** 889 Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. 890 */ 891 void areaAddShape(in RID area, in RID shape, in Transform transform = Transform.init, in bool disabled = false) 892 { 893 checkClassBinding!(typeof(this))(); 894 ptrcall!(void)(GDNativeClassBinding.areaAddShape, _godot_object, area, shape, transform, disabled); 895 } 896 /** 897 Assigns the area to a descendant of $(D GodotObject), so it can exist in the node tree. 898 */ 899 void areaAttachObjectInstanceId(in RID area, in long id) 900 { 901 checkClassBinding!(typeof(this))(); 902 ptrcall!(void)(GDNativeClassBinding.areaAttachObjectInstanceId, _godot_object, area, id); 903 } 904 /** 905 Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. 906 */ 907 void areaClearShapes(in RID area) 908 { 909 checkClassBinding!(typeof(this))(); 910 ptrcall!(void)(GDNativeClassBinding.areaClearShapes, _godot_object, area); 911 } 912 /** 913 Creates an $(D Area). 914 */ 915 RID areaCreate() 916 { 917 checkClassBinding!(typeof(this))(); 918 return ptrcall!(RID)(GDNativeClassBinding.areaCreate, _godot_object); 919 } 920 /** 921 Gets the instance ID of the object the area is assigned to. 922 */ 923 long areaGetObjectInstanceId(in RID area) const 924 { 925 checkClassBinding!(typeof(this))(); 926 return ptrcall!(long)(GDNativeClassBinding.areaGetObjectInstanceId, _godot_object, area); 927 } 928 /** 929 Returns an area parameter value. A list of available parameters is on the $(D areaparameter) constants. 930 */ 931 Variant areaGetParam(in RID area, in long param) const 932 { 933 checkClassBinding!(typeof(this))(); 934 return ptrcall!(Variant)(GDNativeClassBinding.areaGetParam, _godot_object, area, param); 935 } 936 /** 937 Returns the $(D RID) of the nth shape of an area. 938 */ 939 RID areaGetShape(in RID area, in long shape_idx) const 940 { 941 checkClassBinding!(typeof(this))(); 942 return ptrcall!(RID)(GDNativeClassBinding.areaGetShape, _godot_object, area, shape_idx); 943 } 944 /** 945 Returns the number of shapes assigned to an area. 946 */ 947 long areaGetShapeCount(in RID area) const 948 { 949 checkClassBinding!(typeof(this))(); 950 return ptrcall!(long)(GDNativeClassBinding.areaGetShapeCount, _godot_object, area); 951 } 952 /** 953 Returns the transform matrix of a shape within an area. 954 */ 955 Transform areaGetShapeTransform(in RID area, in long shape_idx) const 956 { 957 checkClassBinding!(typeof(this))(); 958 return ptrcall!(Transform)(GDNativeClassBinding.areaGetShapeTransform, _godot_object, area, shape_idx); 959 } 960 /** 961 Returns the space assigned to the area. 962 */ 963 RID areaGetSpace(in RID area) const 964 { 965 checkClassBinding!(typeof(this))(); 966 return ptrcall!(RID)(GDNativeClassBinding.areaGetSpace, _godot_object, area); 967 } 968 /** 969 Returns the space override mode for the area. 970 */ 971 PhysicsServer.AreaSpaceOverrideMode areaGetSpaceOverrideMode(in RID area) const 972 { 973 checkClassBinding!(typeof(this))(); 974 return ptrcall!(PhysicsServer.AreaSpaceOverrideMode)(GDNativeClassBinding.areaGetSpaceOverrideMode, _godot_object, area); 975 } 976 /** 977 Returns the transform matrix for an area. 978 */ 979 Transform areaGetTransform(in RID area) const 980 { 981 checkClassBinding!(typeof(this))(); 982 return ptrcall!(Transform)(GDNativeClassBinding.areaGetTransform, _godot_object, area); 983 } 984 /** 985 If `true`, area collides with rays. 986 */ 987 bool areaIsRayPickable(in RID area) const 988 { 989 checkClassBinding!(typeof(this))(); 990 return ptrcall!(bool)(GDNativeClassBinding.areaIsRayPickable, _godot_object, area); 991 } 992 /** 993 Removes a shape from an area. It does not delete the shape, so it can be reassigned later. 994 */ 995 void areaRemoveShape(in RID area, in long shape_idx) 996 { 997 checkClassBinding!(typeof(this))(); 998 ptrcall!(void)(GDNativeClassBinding.areaRemoveShape, _godot_object, area, shape_idx); 999 } 1000 /** 1001 1002 */ 1003 void areaSetAreaMonitorCallback(in RID area, GodotObject receiver, in String method) 1004 { 1005 checkClassBinding!(typeof(this))(); 1006 ptrcall!(void)(GDNativeClassBinding.areaSetAreaMonitorCallback, _godot_object, area, receiver, method); 1007 } 1008 /** 1009 Assigns the area to one or many physics layers. 1010 */ 1011 void areaSetCollisionLayer(in RID area, in long layer) 1012 { 1013 checkClassBinding!(typeof(this))(); 1014 ptrcall!(void)(GDNativeClassBinding.areaSetCollisionLayer, _godot_object, area, layer); 1015 } 1016 /** 1017 Sets which physics layers the area will monitor. 1018 */ 1019 void areaSetCollisionMask(in RID area, in long mask) 1020 { 1021 checkClassBinding!(typeof(this))(); 1022 ptrcall!(void)(GDNativeClassBinding.areaSetCollisionMask, _godot_object, area, mask); 1023 } 1024 /** 1025 Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: 1026 1: $(D constant AREA_BODY_ADDED) or $(D constant AREA_BODY_REMOVED), depending on whether the object entered or exited the area. 1027 2: $(D RID) of the object that entered/exited the area. 1028 3: Instance ID of the object that entered/exited the area. 1029 4: The shape index of the object that entered/exited the area. 1030 5: The shape index of the area where the object entered/exited. 1031 */ 1032 void areaSetMonitorCallback(in RID area, GodotObject receiver, in String method) 1033 { 1034 checkClassBinding!(typeof(this))(); 1035 ptrcall!(void)(GDNativeClassBinding.areaSetMonitorCallback, _godot_object, area, receiver, method); 1036 } 1037 /** 1038 1039 */ 1040 void areaSetMonitorable(in RID area, in bool monitorable) 1041 { 1042 checkClassBinding!(typeof(this))(); 1043 ptrcall!(void)(GDNativeClassBinding.areaSetMonitorable, _godot_object, area, monitorable); 1044 } 1045 /** 1046 Sets the value for an area parameter. A list of available parameters is on the $(D areaparameter) constants. 1047 */ 1048 void areaSetParam(VariantArg2)(in RID area, in long param, in VariantArg2 value) 1049 { 1050 checkClassBinding!(typeof(this))(); 1051 ptrcall!(void)(GDNativeClassBinding.areaSetParam, _godot_object, area, param, value); 1052 } 1053 /** 1054 Sets object pickable with rays. 1055 */ 1056 void areaSetRayPickable(in RID area, in bool enable) 1057 { 1058 checkClassBinding!(typeof(this))(); 1059 ptrcall!(void)(GDNativeClassBinding.areaSetRayPickable, _godot_object, area, enable); 1060 } 1061 /** 1062 Substitutes a given area shape by another. The old shape is selected by its index, the new one by its $(D RID). 1063 */ 1064 void areaSetShape(in RID area, in long shape_idx, in RID shape) 1065 { 1066 checkClassBinding!(typeof(this))(); 1067 ptrcall!(void)(GDNativeClassBinding.areaSetShape, _godot_object, area, shape_idx, shape); 1068 } 1069 /** 1070 1071 */ 1072 void areaSetShapeDisabled(in RID area, in long shape_idx, in bool disabled) 1073 { 1074 checkClassBinding!(typeof(this))(); 1075 ptrcall!(void)(GDNativeClassBinding.areaSetShapeDisabled, _godot_object, area, shape_idx, disabled); 1076 } 1077 /** 1078 Sets the transform matrix for an area shape. 1079 */ 1080 void areaSetShapeTransform(in RID area, in long shape_idx, in Transform transform) 1081 { 1082 checkClassBinding!(typeof(this))(); 1083 ptrcall!(void)(GDNativeClassBinding.areaSetShapeTransform, _godot_object, area, shape_idx, transform); 1084 } 1085 /** 1086 Assigns a space to the area. 1087 */ 1088 void areaSetSpace(in RID area, in RID space) 1089 { 1090 checkClassBinding!(typeof(this))(); 1091 ptrcall!(void)(GDNativeClassBinding.areaSetSpace, _godot_object, area, space); 1092 } 1093 /** 1094 Sets the space override mode for the area. The modes are described in the $(D areaspaceoverridemode) constants. 1095 */ 1096 void areaSetSpaceOverrideMode(in RID area, in long mode) 1097 { 1098 checkClassBinding!(typeof(this))(); 1099 ptrcall!(void)(GDNativeClassBinding.areaSetSpaceOverrideMode, _godot_object, area, mode); 1100 } 1101 /** 1102 Sets the transform matrix for an area. 1103 */ 1104 void areaSetTransform(in RID area, in Transform transform) 1105 { 1106 checkClassBinding!(typeof(this))(); 1107 ptrcall!(void)(GDNativeClassBinding.areaSetTransform, _godot_object, area, transform); 1108 } 1109 /** 1110 1111 */ 1112 void bodyAddCentralForce(in RID _body, in Vector3 force) 1113 { 1114 checkClassBinding!(typeof(this))(); 1115 ptrcall!(void)(GDNativeClassBinding.bodyAddCentralForce, _godot_object, _body, force); 1116 } 1117 /** 1118 Adds a body to the list of bodies exempt from collisions. 1119 */ 1120 void bodyAddCollisionException(in RID _body, in RID excepted_body) 1121 { 1122 checkClassBinding!(typeof(this))(); 1123 ptrcall!(void)(GDNativeClassBinding.bodyAddCollisionException, _godot_object, _body, excepted_body); 1124 } 1125 /** 1126 1127 */ 1128 void bodyAddForce(in RID _body, in Vector3 force, in Vector3 position) 1129 { 1130 checkClassBinding!(typeof(this))(); 1131 ptrcall!(void)(GDNativeClassBinding.bodyAddForce, _godot_object, _body, force, position); 1132 } 1133 /** 1134 Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. 1135 */ 1136 void bodyAddShape(in RID _body, in RID shape, in Transform transform = Transform.init, in bool disabled = false) 1137 { 1138 checkClassBinding!(typeof(this))(); 1139 ptrcall!(void)(GDNativeClassBinding.bodyAddShape, _godot_object, _body, shape, transform, disabled); 1140 } 1141 /** 1142 1143 */ 1144 void bodyAddTorque(in RID _body, in Vector3 torque) 1145 { 1146 checkClassBinding!(typeof(this))(); 1147 ptrcall!(void)(GDNativeClassBinding.bodyAddTorque, _godot_object, _body, torque); 1148 } 1149 /** 1150 1151 */ 1152 void bodyApplyCentralImpulse(in RID _body, in Vector3 impulse) 1153 { 1154 checkClassBinding!(typeof(this))(); 1155 ptrcall!(void)(GDNativeClassBinding.bodyApplyCentralImpulse, _godot_object, _body, impulse); 1156 } 1157 /** 1158 Gives the body a push at a `position` in the direction of the `impulse`. 1159 */ 1160 void bodyApplyImpulse(in RID _body, in Vector3 position, in Vector3 impulse) 1161 { 1162 checkClassBinding!(typeof(this))(); 1163 ptrcall!(void)(GDNativeClassBinding.bodyApplyImpulse, _godot_object, _body, position, impulse); 1164 } 1165 /** 1166 Gives the body a push to rotate it. 1167 */ 1168 void bodyApplyTorqueImpulse(in RID _body, in Vector3 impulse) 1169 { 1170 checkClassBinding!(typeof(this))(); 1171 ptrcall!(void)(GDNativeClassBinding.bodyApplyTorqueImpulse, _godot_object, _body, impulse); 1172 } 1173 /** 1174 Assigns the area to a descendant of $(D GodotObject), so it can exist in the node tree. 1175 */ 1176 void bodyAttachObjectInstanceId(in RID _body, in long id) 1177 { 1178 checkClassBinding!(typeof(this))(); 1179 ptrcall!(void)(GDNativeClassBinding.bodyAttachObjectInstanceId, _godot_object, _body, id); 1180 } 1181 /** 1182 Removes all shapes from a body. 1183 */ 1184 void bodyClearShapes(in RID _body) 1185 { 1186 checkClassBinding!(typeof(this))(); 1187 ptrcall!(void)(GDNativeClassBinding.bodyClearShapes, _godot_object, _body); 1188 } 1189 /** 1190 Creates a physics body. The first parameter can be any value from $(D bodymode) constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. 1191 */ 1192 RID bodyCreate(in long mode = 2, in bool init_sleeping = false) 1193 { 1194 checkClassBinding!(typeof(this))(); 1195 return ptrcall!(RID)(GDNativeClassBinding.bodyCreate, _godot_object, mode, init_sleeping); 1196 } 1197 /** 1198 Returns the physics layer or layers a body belongs to. 1199 */ 1200 long bodyGetCollisionLayer(in RID _body) const 1201 { 1202 checkClassBinding!(typeof(this))(); 1203 return ptrcall!(long)(GDNativeClassBinding.bodyGetCollisionLayer, _godot_object, _body); 1204 } 1205 /** 1206 Returns the physics layer or layers a body can collide with. 1207 - 1208 */ 1209 long bodyGetCollisionMask(in RID _body) const 1210 { 1211 checkClassBinding!(typeof(this))(); 1212 return ptrcall!(long)(GDNativeClassBinding.bodyGetCollisionMask, _godot_object, _body); 1213 } 1214 /** 1215 Returns the $(D PhysicsDirectBodyState) of the body. 1216 */ 1217 PhysicsDirectBodyState bodyGetDirectState(in RID _body) 1218 { 1219 checkClassBinding!(typeof(this))(); 1220 return ptrcall!(PhysicsDirectBodyState)(GDNativeClassBinding.bodyGetDirectState, _godot_object, _body); 1221 } 1222 /** 1223 1224 */ 1225 double bodyGetKinematicSafeMargin(in RID _body) const 1226 { 1227 checkClassBinding!(typeof(this))(); 1228 return ptrcall!(double)(GDNativeClassBinding.bodyGetKinematicSafeMargin, _godot_object, _body); 1229 } 1230 /** 1231 Returns the maximum contacts that can be reported. See $(D bodySetMaxContactsReported). 1232 */ 1233 long bodyGetMaxContactsReported(in RID _body) const 1234 { 1235 checkClassBinding!(typeof(this))(); 1236 return ptrcall!(long)(GDNativeClassBinding.bodyGetMaxContactsReported, _godot_object, _body); 1237 } 1238 /** 1239 Returns the body mode. 1240 */ 1241 PhysicsServer.BodyMode bodyGetMode(in RID _body) const 1242 { 1243 checkClassBinding!(typeof(this))(); 1244 return ptrcall!(PhysicsServer.BodyMode)(GDNativeClassBinding.bodyGetMode, _godot_object, _body); 1245 } 1246 /** 1247 Gets the instance ID of the object the area is assigned to. 1248 */ 1249 long bodyGetObjectInstanceId(in RID _body) const 1250 { 1251 checkClassBinding!(typeof(this))(); 1252 return ptrcall!(long)(GDNativeClassBinding.bodyGetObjectInstanceId, _godot_object, _body); 1253 } 1254 /** 1255 Returns the value of a body parameter. A list of available parameters is on the $(D bodyparameter) constants. 1256 */ 1257 double bodyGetParam(in RID _body, in long param) const 1258 { 1259 checkClassBinding!(typeof(this))(); 1260 return ptrcall!(double)(GDNativeClassBinding.bodyGetParam, _godot_object, _body, param); 1261 } 1262 /** 1263 Returns the $(D RID) of the nth shape of a body. 1264 */ 1265 RID bodyGetShape(in RID _body, in long shape_idx) const 1266 { 1267 checkClassBinding!(typeof(this))(); 1268 return ptrcall!(RID)(GDNativeClassBinding.bodyGetShape, _godot_object, _body, shape_idx); 1269 } 1270 /** 1271 Returns the number of shapes assigned to a body. 1272 */ 1273 long bodyGetShapeCount(in RID _body) const 1274 { 1275 checkClassBinding!(typeof(this))(); 1276 return ptrcall!(long)(GDNativeClassBinding.bodyGetShapeCount, _godot_object, _body); 1277 } 1278 /** 1279 Returns the transform matrix of a body shape. 1280 */ 1281 Transform bodyGetShapeTransform(in RID _body, in long shape_idx) const 1282 { 1283 checkClassBinding!(typeof(this))(); 1284 return ptrcall!(Transform)(GDNativeClassBinding.bodyGetShapeTransform, _godot_object, _body, shape_idx); 1285 } 1286 /** 1287 Returns the $(D RID) of the space assigned to a body. 1288 */ 1289 RID bodyGetSpace(in RID _body) const 1290 { 1291 checkClassBinding!(typeof(this))(); 1292 return ptrcall!(RID)(GDNativeClassBinding.bodyGetSpace, _godot_object, _body); 1293 } 1294 /** 1295 Returns a body state. 1296 */ 1297 Variant bodyGetState(in RID _body, in long state) const 1298 { 1299 checkClassBinding!(typeof(this))(); 1300 return ptrcall!(Variant)(GDNativeClassBinding.bodyGetState, _godot_object, _body, state); 1301 } 1302 /** 1303 1304 */ 1305 bool bodyIsAxisLocked(in RID _body, in long axis) const 1306 { 1307 checkClassBinding!(typeof(this))(); 1308 return ptrcall!(bool)(GDNativeClassBinding.bodyIsAxisLocked, _godot_object, _body, axis); 1309 } 1310 /** 1311 If `true`, the continuous collision detection mode is enabled. 1312 */ 1313 bool bodyIsContinuousCollisionDetectionEnabled(in RID _body) const 1314 { 1315 checkClassBinding!(typeof(this))(); 1316 return ptrcall!(bool)(GDNativeClassBinding.bodyIsContinuousCollisionDetectionEnabled, _godot_object, _body); 1317 } 1318 /** 1319 Returns whether a body uses a callback function to calculate its own physics (see $(D bodySetForceIntegrationCallback)). 1320 */ 1321 bool bodyIsOmittingForceIntegration(in RID _body) const 1322 { 1323 checkClassBinding!(typeof(this))(); 1324 return ptrcall!(bool)(GDNativeClassBinding.bodyIsOmittingForceIntegration, _godot_object, _body); 1325 } 1326 /** 1327 If `true`, the body can be detected by rays. 1328 */ 1329 bool bodyIsRayPickable(in RID _body) const 1330 { 1331 checkClassBinding!(typeof(this))(); 1332 return ptrcall!(bool)(GDNativeClassBinding.bodyIsRayPickable, _godot_object, _body); 1333 } 1334 /** 1335 Removes a body from the list of bodies exempt from collisions. 1336 Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. 1337 */ 1338 void bodyRemoveCollisionException(in RID _body, in RID excepted_body) 1339 { 1340 checkClassBinding!(typeof(this))(); 1341 ptrcall!(void)(GDNativeClassBinding.bodyRemoveCollisionException, _godot_object, _body, excepted_body); 1342 } 1343 /** 1344 Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. 1345 */ 1346 void bodyRemoveShape(in RID _body, in long shape_idx) 1347 { 1348 checkClassBinding!(typeof(this))(); 1349 ptrcall!(void)(GDNativeClassBinding.bodyRemoveShape, _godot_object, _body, shape_idx); 1350 } 1351 /** 1352 1353 */ 1354 void bodySetAxisLock(in RID _body, in long axis, in bool lock) 1355 { 1356 checkClassBinding!(typeof(this))(); 1357 ptrcall!(void)(GDNativeClassBinding.bodySetAxisLock, _godot_object, _body, axis, lock); 1358 } 1359 /** 1360 Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. 1361 */ 1362 void bodySetAxisVelocity(in RID _body, in Vector3 axis_velocity) 1363 { 1364 checkClassBinding!(typeof(this))(); 1365 ptrcall!(void)(GDNativeClassBinding.bodySetAxisVelocity, _godot_object, _body, axis_velocity); 1366 } 1367 /** 1368 Sets the physics layer or layers a body belongs to. 1369 */ 1370 void bodySetCollisionLayer(in RID _body, in long layer) 1371 { 1372 checkClassBinding!(typeof(this))(); 1373 ptrcall!(void)(GDNativeClassBinding.bodySetCollisionLayer, _godot_object, _body, layer); 1374 } 1375 /** 1376 Sets the physics layer or layers a body can collide with. 1377 */ 1378 void bodySetCollisionMask(in RID _body, in long mask) 1379 { 1380 checkClassBinding!(typeof(this))(); 1381 ptrcall!(void)(GDNativeClassBinding.bodySetCollisionMask, _godot_object, _body, mask); 1382 } 1383 /** 1384 If `true`, the continuous collision detection mode is enabled. 1385 Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. 1386 */ 1387 void bodySetEnableContinuousCollisionDetection(in RID _body, in bool enable) 1388 { 1389 checkClassBinding!(typeof(this))(); 1390 ptrcall!(void)(GDNativeClassBinding.bodySetEnableContinuousCollisionDetection, _godot_object, _body, enable); 1391 } 1392 /** 1393 Sets the function used to calculate physics for an object, if that object allows it (see $(D bodySetOmitForceIntegration)). 1394 */ 1395 void bodySetForceIntegrationCallback(VariantArg3)(in RID _body, GodotObject receiver, in String method, in VariantArg3 userdata = Variant.nil) 1396 { 1397 checkClassBinding!(typeof(this))(); 1398 ptrcall!(void)(GDNativeClassBinding.bodySetForceIntegrationCallback, _godot_object, _body, receiver, method, userdata); 1399 } 1400 /** 1401 1402 */ 1403 void bodySetKinematicSafeMargin(in RID _body, in double margin) 1404 { 1405 checkClassBinding!(typeof(this))(); 1406 ptrcall!(void)(GDNativeClassBinding.bodySetKinematicSafeMargin, _godot_object, _body, margin); 1407 } 1408 /** 1409 Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. 1410 */ 1411 void bodySetMaxContactsReported(in RID _body, in long amount) 1412 { 1413 checkClassBinding!(typeof(this))(); 1414 ptrcall!(void)(GDNativeClassBinding.bodySetMaxContactsReported, _godot_object, _body, amount); 1415 } 1416 /** 1417 Sets the body mode, from one of the $(D bodymode) constants. 1418 */ 1419 void bodySetMode(in RID _body, in long mode) 1420 { 1421 checkClassBinding!(typeof(this))(); 1422 ptrcall!(void)(GDNativeClassBinding.bodySetMode, _godot_object, _body, mode); 1423 } 1424 /** 1425 Sets whether a body uses a callback function to calculate its own physics (see $(D bodySetForceIntegrationCallback)). 1426 */ 1427 void bodySetOmitForceIntegration(in RID _body, in bool enable) 1428 { 1429 checkClassBinding!(typeof(this))(); 1430 ptrcall!(void)(GDNativeClassBinding.bodySetOmitForceIntegration, _godot_object, _body, enable); 1431 } 1432 /** 1433 Sets a body parameter. A list of available parameters is on the $(D bodyparameter) constants. 1434 */ 1435 void bodySetParam(in RID _body, in long param, in double value) 1436 { 1437 checkClassBinding!(typeof(this))(); 1438 ptrcall!(void)(GDNativeClassBinding.bodySetParam, _godot_object, _body, param, value); 1439 } 1440 /** 1441 Sets the body pickable with rays if `enabled` is set. 1442 */ 1443 void bodySetRayPickable(in RID _body, in bool enable) 1444 { 1445 checkClassBinding!(typeof(this))(); 1446 ptrcall!(void)(GDNativeClassBinding.bodySetRayPickable, _godot_object, _body, enable); 1447 } 1448 /** 1449 Substitutes a given body shape by another. The old shape is selected by its index, the new one by its $(D RID). 1450 */ 1451 void bodySetShape(in RID _body, in long shape_idx, in RID shape) 1452 { 1453 checkClassBinding!(typeof(this))(); 1454 ptrcall!(void)(GDNativeClassBinding.bodySetShape, _godot_object, _body, shape_idx, shape); 1455 } 1456 /** 1457 1458 */ 1459 void bodySetShapeDisabled(in RID _body, in long shape_idx, in bool disabled) 1460 { 1461 checkClassBinding!(typeof(this))(); 1462 ptrcall!(void)(GDNativeClassBinding.bodySetShapeDisabled, _godot_object, _body, shape_idx, disabled); 1463 } 1464 /** 1465 Sets the transform matrix for a body shape. 1466 */ 1467 void bodySetShapeTransform(in RID _body, in long shape_idx, in Transform transform) 1468 { 1469 checkClassBinding!(typeof(this))(); 1470 ptrcall!(void)(GDNativeClassBinding.bodySetShapeTransform, _godot_object, _body, shape_idx, transform); 1471 } 1472 /** 1473 Assigns a space to the body (see $(D spaceCreate)). 1474 */ 1475 void bodySetSpace(in RID _body, in RID space) 1476 { 1477 checkClassBinding!(typeof(this))(); 1478 ptrcall!(void)(GDNativeClassBinding.bodySetSpace, _godot_object, _body, space); 1479 } 1480 /** 1481 Sets a body state (see $(D bodystate) constants). 1482 */ 1483 void bodySetState(VariantArg2)(in RID _body, in long state, in VariantArg2 value) 1484 { 1485 checkClassBinding!(typeof(this))(); 1486 ptrcall!(void)(GDNativeClassBinding.bodySetState, _godot_object, _body, state, value); 1487 } 1488 /** 1489 Gets a cone_twist_joint parameter (see $(D conetwistjointparam) constants). 1490 */ 1491 double coneTwistJointGetParam(in RID joint, in long param) const 1492 { 1493 checkClassBinding!(typeof(this))(); 1494 return ptrcall!(double)(GDNativeClassBinding.coneTwistJointGetParam, _godot_object, joint, param); 1495 } 1496 /** 1497 Sets a cone_twist_joint parameter (see $(D conetwistjointparam) constants). 1498 */ 1499 void coneTwistJointSetParam(in RID joint, in long param, in double value) 1500 { 1501 checkClassBinding!(typeof(this))(); 1502 ptrcall!(void)(GDNativeClassBinding.coneTwistJointSetParam, _godot_object, joint, param, value); 1503 } 1504 /** 1505 Destroys any of the objects created by PhysicsServer. If the $(D RID) passed is not one of the objects that can be created by PhysicsServer, an error will be sent to the console. 1506 */ 1507 void freeRid(in RID rid) 1508 { 1509 checkClassBinding!(typeof(this))(); 1510 ptrcall!(void)(GDNativeClassBinding.freeRid, _godot_object, rid); 1511 } 1512 /** 1513 Gets a generic_6_DOF_joint flag (see $(D g6dofjointaxisflag) constants). 1514 */ 1515 bool generic6dofJointGetFlag(in RID joint, in long axis, in long flag) 1516 { 1517 checkClassBinding!(typeof(this))(); 1518 return ptrcall!(bool)(GDNativeClassBinding.generic6dofJointGetFlag, _godot_object, joint, axis, flag); 1519 } 1520 /** 1521 Gets a generic_6_DOF_joint parameter (see $(D g6dofjointaxisparam) constants). 1522 */ 1523 double generic6dofJointGetParam(in RID joint, in long axis, in long param) 1524 { 1525 checkClassBinding!(typeof(this))(); 1526 return ptrcall!(double)(GDNativeClassBinding.generic6dofJointGetParam, _godot_object, joint, axis, param); 1527 } 1528 /** 1529 Sets a generic_6_DOF_joint flag (see $(D g6dofjointaxisflag) constants). 1530 */ 1531 void generic6dofJointSetFlag(in RID joint, in long axis, in long flag, in bool enable) 1532 { 1533 checkClassBinding!(typeof(this))(); 1534 ptrcall!(void)(GDNativeClassBinding.generic6dofJointSetFlag, _godot_object, joint, axis, flag, enable); 1535 } 1536 /** 1537 Sets a generic_6_DOF_joint parameter (see $(D g6dofjointaxisparam) constants). 1538 */ 1539 void generic6dofJointSetParam(in RID joint, in long axis, in long param, in double value) 1540 { 1541 checkClassBinding!(typeof(this))(); 1542 ptrcall!(void)(GDNativeClassBinding.generic6dofJointSetParam, _godot_object, joint, axis, param, value); 1543 } 1544 /** 1545 Returns an Info defined by the $(D processinfo) input given. 1546 */ 1547 long getProcessInfo(in long process_info) 1548 { 1549 checkClassBinding!(typeof(this))(); 1550 return ptrcall!(long)(GDNativeClassBinding.getProcessInfo, _godot_object, process_info); 1551 } 1552 /** 1553 Gets a hinge_joint flag (see $(D hingejointflag) constants). 1554 */ 1555 bool hingeJointGetFlag(in RID joint, in long flag) const 1556 { 1557 checkClassBinding!(typeof(this))(); 1558 return ptrcall!(bool)(GDNativeClassBinding.hingeJointGetFlag, _godot_object, joint, flag); 1559 } 1560 /** 1561 Gets a hinge_joint parameter (see $(D hingejointparam)). 1562 */ 1563 double hingeJointGetParam(in RID joint, in long param) const 1564 { 1565 checkClassBinding!(typeof(this))(); 1566 return ptrcall!(double)(GDNativeClassBinding.hingeJointGetParam, _godot_object, joint, param); 1567 } 1568 /** 1569 Sets a hinge_joint flag (see $(D hingejointflag) constants). 1570 */ 1571 void hingeJointSetFlag(in RID joint, in long flag, in bool enabled) 1572 { 1573 checkClassBinding!(typeof(this))(); 1574 ptrcall!(void)(GDNativeClassBinding.hingeJointSetFlag, _godot_object, joint, flag, enabled); 1575 } 1576 /** 1577 Sets a hinge_joint parameter (see $(D hingejointparam) constants). 1578 */ 1579 void hingeJointSetParam(in RID joint, in long param, in double value) 1580 { 1581 checkClassBinding!(typeof(this))(); 1582 ptrcall!(void)(GDNativeClassBinding.hingeJointSetParam, _godot_object, joint, param, value); 1583 } 1584 /** 1585 Creates a $(D ConeTwistJoint). 1586 */ 1587 RID jointCreateConeTwist(in RID body_A, in Transform local_ref_A, in RID body_B, in Transform local_ref_B) 1588 { 1589 checkClassBinding!(typeof(this))(); 1590 return ptrcall!(RID)(GDNativeClassBinding.jointCreateConeTwist, _godot_object, body_A, local_ref_A, body_B, local_ref_B); 1591 } 1592 /** 1593 Creates a $(D Generic6DOFJoint). 1594 */ 1595 RID jointCreateGeneric6dof(in RID body_A, in Transform local_ref_A, in RID body_B, in Transform local_ref_B) 1596 { 1597 checkClassBinding!(typeof(this))(); 1598 return ptrcall!(RID)(GDNativeClassBinding.jointCreateGeneric6dof, _godot_object, body_A, local_ref_A, body_B, local_ref_B); 1599 } 1600 /** 1601 Creates a $(D HingeJoint). 1602 */ 1603 RID jointCreateHinge(in RID body_A, in Transform hinge_A, in RID body_B, in Transform hinge_B) 1604 { 1605 checkClassBinding!(typeof(this))(); 1606 return ptrcall!(RID)(GDNativeClassBinding.jointCreateHinge, _godot_object, body_A, hinge_A, body_B, hinge_B); 1607 } 1608 /** 1609 Creates a $(D PinJoint). 1610 */ 1611 RID jointCreatePin(in RID body_A, in Vector3 local_A, in RID body_B, in Vector3 local_B) 1612 { 1613 checkClassBinding!(typeof(this))(); 1614 return ptrcall!(RID)(GDNativeClassBinding.jointCreatePin, _godot_object, body_A, local_A, body_B, local_B); 1615 } 1616 /** 1617 Creates a $(D SliderJoint). 1618 */ 1619 RID jointCreateSlider(in RID body_A, in Transform local_ref_A, in RID body_B, in Transform local_ref_B) 1620 { 1621 checkClassBinding!(typeof(this))(); 1622 return ptrcall!(RID)(GDNativeClassBinding.jointCreateSlider, _godot_object, body_A, local_ref_A, body_B, local_ref_B); 1623 } 1624 /** 1625 Gets the priority value of the Joint. 1626 */ 1627 long jointGetSolverPriority(in RID joint) const 1628 { 1629 checkClassBinding!(typeof(this))(); 1630 return ptrcall!(long)(GDNativeClassBinding.jointGetSolverPriority, _godot_object, joint); 1631 } 1632 /** 1633 Returns the type of the Joint. 1634 */ 1635 PhysicsServer.JointType jointGetType(in RID joint) const 1636 { 1637 checkClassBinding!(typeof(this))(); 1638 return ptrcall!(PhysicsServer.JointType)(GDNativeClassBinding.jointGetType, _godot_object, joint); 1639 } 1640 /** 1641 Sets the priority value of the Joint. 1642 */ 1643 void jointSetSolverPriority(in RID joint, in long priority) 1644 { 1645 checkClassBinding!(typeof(this))(); 1646 ptrcall!(void)(GDNativeClassBinding.jointSetSolverPriority, _godot_object, joint, priority); 1647 } 1648 /** 1649 Returns position of the joint in the local space of body a of the joint. 1650 */ 1651 Vector3 pinJointGetLocalA(in RID joint) const 1652 { 1653 checkClassBinding!(typeof(this))(); 1654 return ptrcall!(Vector3)(GDNativeClassBinding.pinJointGetLocalA, _godot_object, joint); 1655 } 1656 /** 1657 Returns position of the joint in the local space of body b of the joint. 1658 */ 1659 Vector3 pinJointGetLocalB(in RID joint) const 1660 { 1661 checkClassBinding!(typeof(this))(); 1662 return ptrcall!(Vector3)(GDNativeClassBinding.pinJointGetLocalB, _godot_object, joint); 1663 } 1664 /** 1665 Gets a pin_joint parameter (see $(D pinjointparam) constants). 1666 */ 1667 double pinJointGetParam(in RID joint, in long param) const 1668 { 1669 checkClassBinding!(typeof(this))(); 1670 return ptrcall!(double)(GDNativeClassBinding.pinJointGetParam, _godot_object, joint, param); 1671 } 1672 /** 1673 Sets position of the joint in the local space of body a of the joint. 1674 */ 1675 void pinJointSetLocalA(in RID joint, in Vector3 local_A) 1676 { 1677 checkClassBinding!(typeof(this))(); 1678 ptrcall!(void)(GDNativeClassBinding.pinJointSetLocalA, _godot_object, joint, local_A); 1679 } 1680 /** 1681 Sets position of the joint in the local space of body b of the joint. 1682 */ 1683 void pinJointSetLocalB(in RID joint, in Vector3 local_B) 1684 { 1685 checkClassBinding!(typeof(this))(); 1686 ptrcall!(void)(GDNativeClassBinding.pinJointSetLocalB, _godot_object, joint, local_B); 1687 } 1688 /** 1689 Sets a pin_joint parameter (see $(D pinjointparam) constants). 1690 */ 1691 void pinJointSetParam(in RID joint, in long param, in double value) 1692 { 1693 checkClassBinding!(typeof(this))(); 1694 ptrcall!(void)(GDNativeClassBinding.pinJointSetParam, _godot_object, joint, param, value); 1695 } 1696 /** 1697 Activates or deactivates the 3D physics engine. 1698 */ 1699 void setActive(in bool active) 1700 { 1701 checkClassBinding!(typeof(this))(); 1702 ptrcall!(void)(GDNativeClassBinding.setActive, _godot_object, active); 1703 } 1704 /** 1705 Creates a shape of a type from $(D shapetype). Does not assign it to a body or an area. To do so, you must use $(D areaSetShape) or $(D bodySetShape). 1706 */ 1707 RID shapeCreate(in long type) 1708 { 1709 checkClassBinding!(typeof(this))(); 1710 return ptrcall!(RID)(GDNativeClassBinding.shapeCreate, _godot_object, type); 1711 } 1712 /** 1713 Returns the shape data. 1714 */ 1715 Variant shapeGetData(in RID shape) const 1716 { 1717 checkClassBinding!(typeof(this))(); 1718 return ptrcall!(Variant)(GDNativeClassBinding.shapeGetData, _godot_object, shape); 1719 } 1720 /** 1721 Returns the type of shape (see $(D shapetype) constants). 1722 */ 1723 PhysicsServer.ShapeType shapeGetType(in RID shape) const 1724 { 1725 checkClassBinding!(typeof(this))(); 1726 return ptrcall!(PhysicsServer.ShapeType)(GDNativeClassBinding.shapeGetType, _godot_object, shape); 1727 } 1728 /** 1729 Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created $(D shapeGetType). 1730 */ 1731 void shapeSetData(VariantArg1)(in RID shape, in VariantArg1 data) 1732 { 1733 checkClassBinding!(typeof(this))(); 1734 ptrcall!(void)(GDNativeClassBinding.shapeSetData, _godot_object, shape, data); 1735 } 1736 /** 1737 Gets a slider_joint parameter (see $(D sliderjointparam) constants). 1738 */ 1739 double sliderJointGetParam(in RID joint, in long param) const 1740 { 1741 checkClassBinding!(typeof(this))(); 1742 return ptrcall!(double)(GDNativeClassBinding.sliderJointGetParam, _godot_object, joint, param); 1743 } 1744 /** 1745 Gets a slider_joint parameter (see $(D sliderjointparam) constants). 1746 */ 1747 void sliderJointSetParam(in RID joint, in long param, in double value) 1748 { 1749 checkClassBinding!(typeof(this))(); 1750 ptrcall!(void)(GDNativeClassBinding.sliderJointSetParam, _godot_object, joint, param, value); 1751 } 1752 /** 1753 Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with $(D areaSetSpace), or to a body with $(D bodySetSpace). 1754 */ 1755 RID spaceCreate() 1756 { 1757 checkClassBinding!(typeof(this))(); 1758 return ptrcall!(RID)(GDNativeClassBinding.spaceCreate, _godot_object); 1759 } 1760 /** 1761 Returns the state of a space, a $(D PhysicsDirectSpaceState). This object can be used to make collision/intersection queries. 1762 */ 1763 PhysicsDirectSpaceState spaceGetDirectState(in RID space) 1764 { 1765 checkClassBinding!(typeof(this))(); 1766 return ptrcall!(PhysicsDirectSpaceState)(GDNativeClassBinding.spaceGetDirectState, _godot_object, space); 1767 } 1768 /** 1769 Returns the value of a space parameter. 1770 */ 1771 double spaceGetParam(in RID space, in long param) const 1772 { 1773 checkClassBinding!(typeof(this))(); 1774 return ptrcall!(double)(GDNativeClassBinding.spaceGetParam, _godot_object, space, param); 1775 } 1776 /** 1777 Returns whether the space is active. 1778 */ 1779 bool spaceIsActive(in RID space) const 1780 { 1781 checkClassBinding!(typeof(this))(); 1782 return ptrcall!(bool)(GDNativeClassBinding.spaceIsActive, _godot_object, space); 1783 } 1784 /** 1785 Marks a space as active. It will not have an effect, unless it is assigned to an area or body. 1786 */ 1787 void spaceSetActive(in RID space, in bool active) 1788 { 1789 checkClassBinding!(typeof(this))(); 1790 ptrcall!(void)(GDNativeClassBinding.spaceSetActive, _godot_object, space, active); 1791 } 1792 /** 1793 Sets the value for a space parameter. A list of available parameters is on the $(D spaceparameter) constants. 1794 */ 1795 void spaceSetParam(in RID space, in long param, in double value) 1796 { 1797 checkClassBinding!(typeof(this))(); 1798 ptrcall!(void)(GDNativeClassBinding.spaceSetParam, _godot_object, space, param, value); 1799 } 1800 } 1801 /// Returns: the PhysicsServerSingleton 1802 @property @nogc nothrow pragma(inline, true) 1803 PhysicsServerSingleton PhysicsServer() 1804 { 1805 checkClassBinding!PhysicsServerSingleton(); 1806 return PhysicsServerSingleton(PhysicsServerSingleton.GDNativeClassBinding._singleton); 1807 }