| 1 | /* Copyright (c) 2013 Scott Lembcke and Howling Moon Software |
| 2 | * |
| 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | * of this software and associated documentation files (the "Software"), to deal |
| 5 | * in the Software without restriction, including without limitation the rights |
| 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | * copies of the Software, and to permit persons to whom the Software is |
| 8 | * furnished to do so, subject to the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included in |
| 11 | * all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 | * SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | #include "chipmunk/chipmunk_private.h"cxx . . $ `<file>/include/chipmunk/chipmunk_private.h`/ |
| 23 | |
| 24 | // TODO: Comment me! |
| 25 | |
| 26 | void cpConstraintDestroycxx . . $ cpConstraintDestroy(ce362f6e378064c6).(cpConstraintcxx . . $ cpConstraint# *constraint){} |
| 27 | |
| 28 | void |
| 29 | cpConstraintFreecxx . . $ cpConstraintFree(ce362f6e378064c6).(cpConstraintcxx . . $ cpConstraint# *constraint) |
| 30 | { |
| 31 | if(constraint){ |
| 32 | cpConstraintDestroycxx . . $ cpConstraintDestroy(ce362f6e378064c6).(constraint); |
| 33 | cpfreecxx . . $ `include/chipmunk/chipmunk.h:82:10`!(constraint); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | void |
| 38 | cpConstraintInitcxx . . $ cpConstraintInit(540fb6eaa94f170).(cpConstraintcxx . . $ cpConstraint# *constraint, const cpConstraintClasscxx . . $ cpConstraintClass# *klass, cpBodycxx . . $ cpBody# *a, cpBodycxx . . $ cpBody# *b) |
| 39 | { |
| 40 | constraint->klasscxx . . $ cpConstraint#klass. = klass; |
| 41 | |
| 42 | constraint->acxx . . $ cpConstraint#a. = a; |
| 43 | constraint->bcxx . . $ cpConstraint#b. = b; |
| 44 | constraint->spacecxx . . $ cpConstraint#space. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 45 | |
| 46 | constraint->next_acxx . . $ cpConstraint#next_a. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 47 | constraint->next_bcxx . . $ cpConstraint#next_b. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 48 | |
| 49 | constraint->maxForcecxx . . $ cpConstraint#maxForce. = (cpFloatcxx . . $ cpFloat#)INFINITYcxx . . $ `<external>/11263917310783833665/math.h:93:12`!; |
| 50 | constraint->errorBiascxx . . $ cpConstraint#errorBias. = cpfpowcxx . . $ `include/chipmunk/chipmunk_types.h:75:10`!(1.0f - 0.1f, 60.0f); |
| 51 | constraint->maxBiascxx . . $ cpConstraint#maxBias. = (cpFloatcxx . . $ cpFloat#)INFINITYcxx . . $ `<external>/11263917310783833665/math.h:93:12`!; |
| 52 | |
| 53 | constraint->collideBodiescxx . . $ cpConstraint#collideBodies. = cpTruecxx . . $ `include/chipmunk/chipmunk_types.h:183:10`!; |
| 54 | |
| 55 | constraint->preSolvecxx . . $ cpConstraint#preSolve. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 56 | constraint->postSolvecxx . . $ cpConstraint#postSolve. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 57 | } |
| 58 | |
| 59 | cpSpacecxx . . $ cpSpace# * |
| 60 | cpConstraintGetSpacecxx . . $ cpConstraintGetSpace(f3e4d09358fcdc2d).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 61 | { |
| 62 | return constraint->spacecxx . . $ cpConstraint#space.; |
| 63 | } |
| 64 | |
| 65 | cpBodycxx . . $ cpBody# * |
| 66 | cpConstraintGetBodyAcxx . . $ cpConstraintGetBodyA(c2664ea2b665a9c2).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 67 | { |
| 68 | return constraint->acxx . . $ cpConstraint#a.; |
| 69 | } |
| 70 | |
| 71 | cpBodycxx . . $ cpBody# * |
| 72 | cpConstraintGetBodyBcxx . . $ cpConstraintGetBodyB(c2664ea2b665a9c2).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 73 | { |
| 74 | return constraint->bcxx . . $ cpConstraint#b.; |
| 75 | } |
| 76 | |
| 77 | cpFloatcxx . . $ cpFloat# |
| 78 | cpConstraintGetMaxForcecxx . . $ cpConstraintGetMaxForce(9c3ac5f8d34d584e).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 79 | { |
| 80 | return constraint->maxForcecxx . . $ cpConstraint#maxForce.; |
| 81 | } |
| 82 | |
| 83 | void |
| 84 | cpConstraintSetMaxForcecxx . . $ cpConstraintSetMaxForce(dfce55250ba9e4fa).(cpConstraintcxx . . $ cpConstraint# *constraint, cpFloatcxx . . $ cpFloat# maxForce) |
| 85 | { |
| 86 | cpAssertHardcxx . . $ `include/chipmunk/chipmunk.h:58:9`!(maxForce >= 0.0f, "maxForce must be positive."); |
| 87 | cpConstraintActivateBodiescxx . . $ cpConstraintActivateBodies(ce362f6e378064c6).(constraint); |
| 88 | constraint->maxForcecxx . . $ cpConstraint#maxForce. = maxForce; |
| 89 | } |
| 90 | |
| 91 | cpFloatcxx . . $ cpFloat# |
| 92 | cpConstraintGetErrorBiascxx . . $ cpConstraintGetErrorBias(9c3ac5f8d34d584e).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 93 | { |
| 94 | return constraint->errorBiascxx . . $ cpConstraint#errorBias.; |
| 95 | } |
| 96 | |
| 97 | void |
| 98 | cpConstraintSetErrorBiascxx . . $ cpConstraintSetErrorBias(dfce55250ba9e4fa).(cpConstraintcxx . . $ cpConstraint# *constraint, cpFloatcxx . . $ cpFloat# errorBias) |
| 99 | { |
| 100 | cpAssertHardcxx . . $ `include/chipmunk/chipmunk.h:58:9`!(errorBias >= 0.0f, "errorBias must be positive."); |
| 101 | cpConstraintActivateBodiescxx . . $ cpConstraintActivateBodies(ce362f6e378064c6).(constraint); |
| 102 | constraint->errorBiascxx . . $ cpConstraint#errorBias. = errorBias; |
| 103 | } |
| 104 | |
| 105 | cpFloatcxx . . $ cpFloat# |
| 106 | cpConstraintGetMaxBiascxx . . $ cpConstraintGetMaxBias(9c3ac5f8d34d584e).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 107 | { |
| 108 | return constraint->maxBiascxx . . $ cpConstraint#maxBias.; |
| 109 | } |
| 110 | |
| 111 | void |
| 112 | cpConstraintSetMaxBiascxx . . $ cpConstraintSetMaxBias(dfce55250ba9e4fa).(cpConstraintcxx . . $ cpConstraint# *constraint, cpFloatcxx . . $ cpFloat# maxBias) |
| 113 | { |
| 114 | cpAssertHardcxx . . $ `include/chipmunk/chipmunk.h:58:9`!(maxBias >= 0.0f, "maxBias must be positive."); |
| 115 | cpConstraintActivateBodiescxx . . $ cpConstraintActivateBodies(ce362f6e378064c6).(constraint); |
| 116 | constraint->maxBiascxx . . $ cpConstraint#maxBias. = maxBias; |
| 117 | } |
| 118 | |
| 119 | cpBoolcxx . . $ cpBool# |
| 120 | cpConstraintGetCollideBodiescxx . . $ cpConstraintGetCollideBodies(ca4e56e976f68364).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 121 | { |
| 122 | return constraint->collideBodiescxx . . $ cpConstraint#collideBodies.; |
| 123 | } |
| 124 | |
| 125 | void |
| 126 | cpConstraintSetCollideBodiescxx . . $ cpConstraintSetCollideBodies(480f56b574d66410).(cpConstraintcxx . . $ cpConstraint# *constraint, cpBoolcxx . . $ cpBool# collideBodies) |
| 127 | { |
| 128 | cpConstraintActivateBodiescxx . . $ cpConstraintActivateBodies(ce362f6e378064c6).(constraint); |
| 129 | constraint->collideBodiescxx . . $ cpConstraint#collideBodies. = collideBodies; |
| 130 | } |
| 131 | |
| 132 | cpConstraintPreSolveFunccxx . . $ cpConstraintPreSolveFunc# |
| 133 | cpConstraintGetPreSolveFunccxx . . $ cpConstraintGetPreSolveFunc(480ede8ce208f40e).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 134 | { |
| 135 | return constraint->preSolvecxx . . $ cpConstraint#preSolve.; |
| 136 | } |
| 137 | |
| 138 | void |
| 139 | cpConstraintSetPreSolveFunccxx . . $ cpConstraintSetPreSolveFunc(4f57467f17129581).(cpConstraintcxx . . $ cpConstraint# *constraint, cpConstraintPreSolveFunccxx . . $ cpConstraintPreSolveFunc# preSolveFunc) |
| 140 | { |
| 141 | constraint->preSolvecxx . . $ cpConstraint#preSolve. = preSolveFunc; |
| 142 | } |
| 143 | |
| 144 | cpConstraintPostSolveFunccxx . . $ cpConstraintPostSolveFunc# |
| 145 | cpConstraintGetPostSolveFunccxx . . $ cpConstraintGetPostSolveFunc(480ede8ce208f40e).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 146 | { |
| 147 | return constraint->postSolvecxx . . $ cpConstraint#postSolve.; |
| 148 | } |
| 149 | |
| 150 | void |
| 151 | cpConstraintSetPostSolveFunccxx . . $ cpConstraintSetPostSolveFunc(4f57467f17129581).(cpConstraintcxx . . $ cpConstraint# *constraint, cpConstraintPostSolveFunccxx . . $ cpConstraintPostSolveFunc# postSolveFunc) |
| 152 | { |
| 153 | constraint->postSolvecxx . . $ cpConstraint#postSolve. = postSolveFunc; |
| 154 | } |
| 155 | |
| 156 | cpDataPointercxx . . $ cpDataPointer# |
| 157 | cpConstraintGetUserDatacxx . . $ cpConstraintGetUserData(388e811cd1b213d2).(const cpConstraintcxx . . $ cpConstraint# *constraint) |
| 158 | { |
| 159 | return constraint->userDatacxx . . $ cpConstraint#userData.; |
| 160 | } |
| 161 | |
| 162 | void |
| 163 | cpConstraintSetUserDatacxx . . $ cpConstraintSetUserData(6734918e6bba5564).(cpConstraintcxx . . $ cpConstraint# *constraint, cpDataPointercxx . . $ cpDataPointer# userData) |
| 164 | { |
| 165 | constraint->userDatacxx . . $ cpConstraint#userData. = userData; |
| 166 | } |
| 167 | |
| 168 | |
| 169 | cpFloatcxx . . $ cpFloat# |
| 170 | cpConstraintGetImpulsecxx . . $ cpConstraintGetImpulse(4f5ff132f97724f3).(cpConstraintcxx . . $ cpConstraint# *constraint) |
| 171 | { |
| 172 | return constraint->klasscxx . . $ cpConstraint#klass.->getImpulsecxx . . $ cpConstraintClass#getImpulse.(constraint); |
| 173 | } |