1 //****************************************************************************//
2 // cal3d_wrapper.cpp //
3 // Copyright (C) 2002 Bruno 'Beosil' Heidelberger //
4 //****************************************************************************//
5 // This library is free software; you can redistribute it and/or modify it //
6 // under the terms of the GNU Lesser General Public License as published by //
7 // the Free Software Foundation; either version 2.1 of the License, or (at //
8 // your option) any later version. //
9 //****************************************************************************//
10
11 #ifdef HAVE_CONFIG_H
12 #include "config.h"
13 #endif
14
15 //****************************************************************************//
16 // Defines //
17 //****************************************************************************//
18
19 #define CAL3D_WRAPPER_EXPORTS
20
21 //****************************************************************************//
22 // Includes //
23 //****************************************************************************//
24
25 #include "cal3d/cal3d.h"
26 #include "cal3d/cal3d_wrapper.h"
27 using namespace cal3d;
28
29 //****************************************************************************//
30 // CalAnimation wrapper functions definition //
31 //****************************************************************************//
32
CalAnimation_Delete(CalAnimation * self)33 void CalAnimation_Delete(CalAnimation *self)
34 {
35 delete self;
36 }
37
CalAnimation_GetCoreAnimation(CalAnimation * self)38 CalCoreAnimation *CalAnimation_GetCoreAnimation(CalAnimation *self)
39 {
40 return self->getCoreAnimation();
41 }
42
CalAnimation_GetState(CalAnimation * self)43 CalAnimationState CalAnimation_GetState(CalAnimation *self)
44 {
45 return (CalAnimationState)(self->getState());
46 }
47
CalAnimation_GetTime(CalAnimation * self)48 float CalAnimation_GetTime(CalAnimation *self)
49 {
50 return self->getTime();
51 }
52
CalAnimation_GetType(CalAnimation * self)53 CalAnimationType CalAnimation_GetType(CalAnimation *self)
54 {
55 return (CalAnimationType)(self->getType());
56 }
57
CalAnimation_GetWeight(CalAnimation * self)58 float CalAnimation_GetWeight(CalAnimation *self)
59 {
60 return self->getWeight();
61 }
62
63 //****************************************************************************//
64 // CalAnimationAction wrapper functions definition //
65 //****************************************************************************//
66
CalAnimationAction_Delete(CalAnimationAction * self)67 void CalAnimationAction_Delete(CalAnimationAction *self)
68 {
69 delete self;
70 }
71
CalAnimationAction_Execute(CalAnimationAction * self,float delayIn,float delayOut)72 Boolean CalAnimationAction_Execute(CalAnimationAction *self, float delayIn, float delayOut)
73 {
74 return self->execute(delayIn, delayOut) ? True : False;
75 }
76
CalAnimationAction_New(CalCoreAnimation * pCoreAnimation)77 CalAnimationAction *CalAnimationAction_New(CalCoreAnimation *pCoreAnimation)
78 {
79 return new CalAnimationAction(pCoreAnimation);
80 }
81
CalAnimationAction_Update(CalAnimationAction * self,float deltaTime)82 Boolean CalAnimationAction_Update(CalAnimationAction *self, float deltaTime)
83 {
84 return self->update(deltaTime) ? True : False;
85 }
86
CalCoreAnimation_Scale(CalCoreAnimation * self,float factor)87 void CalCoreAnimation_Scale(CalCoreAnimation *self, float factor)
88 {
89 self->scale(factor);
90 }
91
92
93 //****************************************************************************//
94 // CalAnimationCycle wrapper functions definition //
95 //****************************************************************************//
96
CalAnimationCycle_Blend(CalAnimationCycle * self,float weight,float delay)97 Boolean CalAnimationCycle_Blend(CalAnimationCycle *self, float weight, float delay)
98 {
99 return self->blend(weight, delay) ? True : False;
100 }
101
CalAnimationCycle_Delete(CalAnimationCycle * self)102 void CalAnimationCycle_Delete(CalAnimationCycle *self)
103 {
104 delete self;
105 }
106
CalAnimationCycle_New(CalCoreAnimation * pCoreAnimation)107 CalAnimationCycle *CalAnimationCycle_New(CalCoreAnimation *pCoreAnimation)
108 {
109 return new CalAnimationCycle(pCoreAnimation);
110 }
111
CalAnimationCycle_SetAsync(CalAnimationCycle * self,float time,float duration)112 void CalAnimationCycle_SetAsync(CalAnimationCycle *self, float time, float duration)
113 {
114 self->setAsync(time, duration);
115 }
116
CalAnimationCycle_Update(CalAnimationCycle * self,float deltaTime)117 Boolean CalAnimationCycle_Update(CalAnimationCycle *self, float deltaTime)
118 {
119 return self->update(deltaTime) ? True : False;
120 }
121
122 //****************************************************************************//
123 // CalBone wrapper functions definition //
124 //****************************************************************************//
125
CalBone_BlendState(CalBone * self,float weight,CalVector * pTranslation,CalQuaternion * pRotation)126 void CalBone_BlendState(CalBone *self, float weight, CalVector *pTranslation, CalQuaternion *pRotation)
127 {
128 self->blendState(weight, *pTranslation, *pRotation);
129 }
130
CalBone_CalculateState(CalBone * self)131 void CalBone_CalculateState(CalBone *self)
132 {
133 self->calculateState();
134 }
135
CalBone_ClearState(CalBone * self)136 void CalBone_ClearState(CalBone *self)
137 {
138 self->clearState();
139 }
140
CalBone_Delete(CalBone * self)141 void CalBone_Delete(CalBone *self)
142 {
143 delete self;
144 }
145
CalBone_GetCoreBone(CalBone * self)146 CalCoreBone *CalBone_GetCoreBone(CalBone *self)
147 {
148 return self->getCoreBone();
149 }
150
CalBone_GetRotation(CalBone * self)151 CalQuaternion *CalBone_GetRotation(CalBone *self)
152 {
153 return &(const_cast<CalQuaternion&>(self->getRotation()));
154 }
155
CalBone_GetRotationAbsolute(CalBone * self)156 CalQuaternion *CalBone_GetRotationAbsolute(CalBone *self)
157 {
158 return &(const_cast<CalQuaternion&>(self->getRotationAbsolute()));
159 }
160
CalBone_GetRotationBoneSpace(CalBone * self)161 CalQuaternion *CalBone_GetRotationBoneSpace(CalBone *self)
162 {
163 return &(const_cast<CalQuaternion&>(self->getRotationBoneSpace()));
164 }
165
CalBone_GetTranslation(CalBone * self)166 CalVector *CalBone_GetTranslation(CalBone *self)
167 {
168 return &(const_cast<CalVector&>(self->getTranslation()));
169 }
170
CalBone_GetTranslationAbsolute(CalBone * self)171 CalVector *CalBone_GetTranslationAbsolute(CalBone *self)
172 {
173 return &(const_cast<CalVector&>(self->getTranslationAbsolute()));
174 }
175
CalBone_GetTranslationBoneSpace(CalBone * self)176 CalVector *CalBone_GetTranslationBoneSpace(CalBone *self)
177 {
178 return &(const_cast<CalVector&>(self->getTranslationBoneSpace()));
179 }
180
CalBone_LockState(CalBone * self)181 void CalBone_LockState(CalBone *self)
182 {
183 self->lockState();
184 }
185
CalBone_New(CalCoreBone * coreBone)186 CalBone *CalBone_New(CalCoreBone* coreBone)
187 {
188 return new CalBone(coreBone);
189 }
190
CalBone_SetSkeleton(CalBone * self,CalSkeleton * pSkeleton)191 void CalBone_SetSkeleton(CalBone *self, CalSkeleton *pSkeleton)
192 {
193 self->setSkeleton(pSkeleton);
194 }
195
CalBone_SetRotation(CalBone * self,CalQuaternion * pRotation)196 void CalBone_SetRotation(CalBone *self, CalQuaternion *pRotation)
197 {
198 self->setRotation(*pRotation);
199 }
200
CalBone_SetTranslation(CalBone * self,CalVector * pTranslation)201 void CalBone_SetTranslation(CalBone *self, CalVector *pTranslation)
202 {
203 self->setTranslation(*pTranslation);
204 }
205
CalBone_SetCoreState(CalBone * self)206 void CalBone_SetCoreState(CalBone *self)
207 {
208 self->setCoreState();
209 }
210
CalBone_SetCoreStateRecursive(CalBone * self)211 void CalBone_SetCoreStateRecursive(CalBone *self)
212 {
213 self->setCoreStateRecursive();
214 }
215
216
217 //****************************************************************************//
218 // CalCoreAnimation wrapper functions definition //
219 //****************************************************************************//
220
CalCoreAnimation_New(CalCoreAnimation * self)221 CalCoreAnimation *CalCoreAnimation_New(CalCoreAnimation *self)
222 {
223 return explicitIncRef(new CalCoreAnimation());
224 }
225
CalCoreAnimation_Delete(CalCoreAnimation * self)226 void CalCoreAnimation_Delete(CalCoreAnimation* self)
227 {
228 explicitDecRef(self);
229 }
230
CalCoreAnimation_GetDuration(CalCoreAnimation * self)231 float CalCoreAnimation_GetDuration(CalCoreAnimation *self)
232 {
233 return self->getDuration();
234 }
235
CalCoreAnimation_SetDuration(CalCoreAnimation * self,float duration)236 void CalCoreAnimation_SetDuration(CalCoreAnimation *self, float duration)
237 {
238 self->setDuration(duration);
239 }
240
241 //****************************************************************************//
242 // CalCoreAnimation wrapper functions definition //
243 //****************************************************************************//
244
CalCoreBone_AddChildId(CalCoreBone * self,int childId)245 Boolean CalCoreBone_AddChildId(CalCoreBone *self, int childId)
246 {
247 return self->addChildId(childId) ? True : False;
248 }
249
CalCoreBone_CalculateState(CalCoreBone * self)250 void CalCoreBone_CalculateState(CalCoreBone *self)
251 {
252 self->calculateState();
253 }
254
CalCoreBone_Delete(CalCoreBone * self)255 void CalCoreBone_Delete(CalCoreBone *self)
256 {
257 delete self;
258 }
259
260 /*
261 std::list<int>& CalCoreBone_GetListChildId(CalCoreBone *self)
262 {
263 return self->getListChildId();
264 }
265 */
266
CalCoreBone_GetName(CalCoreBone * self)267 char *CalCoreBone_GetName(CalCoreBone *self)
268 {
269 return const_cast<char *>(self->getName().c_str());
270 }
271
CalCoreBone_GetParentId(CalCoreBone * self)272 int CalCoreBone_GetParentId(CalCoreBone *self)
273 {
274 return self->getParentId();
275 }
276
CalCoreBone_GetRotation(CalCoreBone * self)277 CalQuaternion *CalCoreBone_GetRotation(CalCoreBone *self)
278 {
279 return &(const_cast<CalQuaternion&>(self->getRotation()));
280 }
281
CalCoreBone_GetRotationAbsolute(CalCoreBone * self)282 CalQuaternion *CalCoreBone_GetRotationAbsolute(CalCoreBone *self)
283 {
284 return &(const_cast<CalQuaternion&>(self->getRotationAbsolute()));
285 }
286
CalCoreBone_GetRotationBoneSpace(CalCoreBone * self)287 CalQuaternion *CalCoreBone_GetRotationBoneSpace(CalCoreBone *self)
288 {
289 return &(const_cast<CalQuaternion&>(self->getRotationBoneSpace()));
290 }
291
CalCoreBone_GetTranslation(CalCoreBone * self)292 CalVector *CalCoreBone_GetTranslation(CalCoreBone *self)
293 {
294 return &(const_cast<CalVector&>(self->getTranslation()));
295 }
296
CalCoreBone_GetTranslationAbsolute(CalCoreBone * self)297 CalVector *CalCoreBone_GetTranslationAbsolute(CalCoreBone *self)
298 {
299 return &(const_cast<CalVector&>(self->getTranslationAbsolute()));
300 }
301
CalCoreBone_GetTranslationBoneSpace(CalCoreBone * self)302 CalVector *CalCoreBone_GetTranslationBoneSpace(CalCoreBone *self)
303 {
304 return &(const_cast<CalVector&>(self->getTranslationBoneSpace()));
305 }
306
CalCoreBone_GetUserData(CalCoreBone * self)307 CalUserData CalCoreBone_GetUserData(CalCoreBone *self)
308 {
309 return self->getUserData();
310 }
311
CalCoreBone_New(const char * name)312 CalCoreBone *CalCoreBone_New(const char* name)
313 {
314 return new CalCoreBone(name);
315 }
316
CalCoreBone_SetCoreSkeleton(CalCoreBone * self,CalCoreSkeleton * pCoreSkeleton)317 void CalCoreBone_SetCoreSkeleton(CalCoreBone *self, CalCoreSkeleton *pCoreSkeleton)
318 {
319 self->setCoreSkeleton(pCoreSkeleton);
320 }
321
CalCoreBone_SetParentId(CalCoreBone * self,int parentId)322 void CalCoreBone_SetParentId(CalCoreBone *self, int parentId)
323 {
324 self->setParentId(parentId);
325 }
326
CalCoreBone_SetRotation(CalCoreBone * self,CalQuaternion * pRotation)327 void CalCoreBone_SetRotation(CalCoreBone *self, CalQuaternion *pRotation)
328 {
329 self->setRotation(*pRotation);
330 }
331
CalCoreBone_SetRotationBoneSpace(CalCoreBone * self,CalQuaternion * pRotation)332 void CalCoreBone_SetRotationBoneSpace(CalCoreBone *self, CalQuaternion *pRotation)
333 {
334 self->setRotationBoneSpace(*pRotation);
335 }
336
CalCoreBone_SetTranslation(CalCoreBone * self,CalVector * pTranslation)337 void CalCoreBone_SetTranslation(CalCoreBone *self, CalVector *pTranslation)
338 {
339 self->setTranslation(*pTranslation);
340 }
341
CalCoreBone_SetTranslationBoneSpace(CalCoreBone * self,CalVector * pTranslation)342 void CalCoreBone_SetTranslationBoneSpace(CalCoreBone *self, CalVector *pTranslation)
343 {
344 self->setTranslationBoneSpace(*pTranslation);
345 }
346
CalCoreBone_SetUserData(CalCoreBone * self,CalUserData userData)347 void CalCoreBone_SetUserData(CalCoreBone *self, CalUserData userData)
348 {
349 self->setUserData(userData);
350 }
351
352 //****************************************************************************//
353 // CalCoreMorphAnimation wrapper functions definition //
354 //****************************************************************************//
355
CalCoreMorphAnimation_New()356 CalCoreMorphAnimation *CalCoreMorphAnimation_New()
357 {
358 return new CalCoreMorphAnimation();
359 }
360
CalCoreMorphAnimation_Delete(CalCoreMorphAnimation * self)361 void CalCoreMorphAnimation_Delete(CalCoreMorphAnimation* self)
362 {
363 delete self;
364 }
365
CalCoreMorphAnimation_AddMorphTarget(struct CalCoreMorphAnimation * self,int meshID,int morphID)366 Boolean CalCoreMorphAnimation_AddMorphTarget(struct CalCoreMorphAnimation* self, int meshID, int morphID)
367 {
368 return self->addMorphTarget(meshID, morphID) ? True : False;
369 }
370
371 //****************************************************************************//
372 // CalCoreMaterial wrapper functions definition //
373 //****************************************************************************//
374
CalCoreMaterial_New()375 CalCoreMaterial *CalCoreMaterial_New()
376 {
377 return explicitIncRef(new CalCoreMaterial());
378 }
379
CalCoreMaterial_Delete(CalCoreMaterial * self)380 void CalCoreMaterial_Delete(CalCoreMaterial *self)
381 {
382 explicitDecRef(self);
383 }
384
385 /*
386 CalCoreMaterial::Color *CalCoreMaterial_GetAmbientColor(CalCoreMaterial *self)
387 {
388 return &(self->getAmbientColor());
389 }
390 */
391 /*
392 CalCoreMaterial::Color *CalCoreMaterial_GetDiffuseColor(CalCoreMaterial *self)
393 {
394 return &(self->getDiffuseColor());
395 }
396 */
397
CalCoreMaterial_GetMapCount(CalCoreMaterial * self)398 int CalCoreMaterial_GetMapCount(CalCoreMaterial *self)
399 {
400 return self->getMapCount();
401 }
402
CalCoreMaterial_GetMapFilename(CalCoreMaterial * self,int mapId)403 char *CalCoreMaterial_GetMapFilename(CalCoreMaterial *self, int mapId)
404 {
405 return const_cast<char *>(self->getMapFilename(mapId).c_str());
406 }
407
CalCoreMaterial_GetMapUserData(CalCoreMaterial * self,int mapId)408 CalUserData CalCoreMaterial_GetMapUserData(CalCoreMaterial *self, int mapId)
409 {
410 return self->getMapUserData(mapId);
411 }
412
CalCoreMaterial_GetShininess(CalCoreMaterial * self)413 float CalCoreMaterial_GetShininess(CalCoreMaterial *self)
414 {
415 return self->getShininess();
416 }
417
418 /*
419 CalCoreMaterial::Color *CalCoreMaterial_GetSpecularColor(CalCoreMaterial *self)
420 {
421 return &(self->getSpecularColor());
422 }
423 */
424
CalCoreMaterial_GetUserData(CalCoreMaterial * self)425 CalUserData CalCoreMaterial_GetUserData(CalCoreMaterial *self)
426 {
427 return self->getUserData();
428 }
429
430 /*
431 std::vector<Map>& CalCoreMaterial_GetVectorMap(CalCoreMaterial *self)
432 {
433 return self->getVectorMap();
434 }
435 */
436
CalCoreMaterial_Reserve(CalCoreMaterial * self,int mapCount)437 Boolean CalCoreMaterial_Reserve(CalCoreMaterial *self, int mapCount)
438 {
439 return self->reserve(mapCount) ? True : False;
440 }
441
442 /*
443 void CalCoreMaterial_SetAmbientColor(CalCoreMaterial *self, CalCoreMaterial::Color *pAmbientColor)
444 {
445 return self->setAmbientColor(*pAmbientColor);
446 }
447 */
448
449 /*
450 void CalCoreMaterial_SetDiffuseColor(CalCoreMaterial *self, CalCoreMaterial::Color *pDiffuseColor)
451 {
452 self->setDiffuseColor(*pDiffuseColor);
453 }
454 */
455
456 /*
457 Boolean CalCoreMaterial_SetMap(CalCoreMaterial *self, int mapId, CalCoreMaterial::Map *pMap)
458 {
459 return self->setMap(mapId, *pMap) ? True : False;
460 }
461 */
462
CalCoreMaterial_SetMapUserData(CalCoreMaterial * self,int mapId,CalUserData userData)463 Boolean CalCoreMaterial_SetMapUserData(CalCoreMaterial *self, int mapId, CalUserData userData)
464 {
465 return self->setMapUserData(mapId, userData) ? True : False;
466 }
467
CalCoreMaterial_SetShininess(CalCoreMaterial * self,float shininess)468 void CalCoreMaterial_SetShininess(CalCoreMaterial *self, float shininess)
469 {
470 self->setShininess(shininess);
471 }
472
473 /*
474 void CalCoreMaterial_SetSpecularColor(CalCoreMaterial *self, CalCoreMaterial::Color *pSpecularColor)
475 {
476 self->setSpecularColor(*pSpecularColor);
477 }
478 */
479
CalCoreMaterial_SetUserData(CalCoreMaterial * self,CalUserData userData)480 void CalCoreMaterial_SetUserData(CalCoreMaterial *self, CalUserData userData)
481 {
482 self->setUserData(userData);
483 }
484
485 //****************************************************************************//
486 // CalCoreMesh wrapper functions definition //
487 //****************************************************************************//
488
CalCoreMesh_New()489 CalCoreMesh *CalCoreMesh_New()
490 {
491 return explicitIncRef(new CalCoreMesh());
492 }
493
CalCoreMesh_Delete(CalCoreMesh * self)494 void CalCoreMesh_Delete(CalCoreMesh *self)
495 {
496 explicitDecRef(self);
497 }
498
CalCoreMesh_AddCoreSubmesh(CalCoreMesh * self,CalCoreSubmesh * pCoreSubmesh)499 int CalCoreMesh_AddCoreSubmesh(CalCoreMesh *self, CalCoreSubmesh *pCoreSubmesh)
500 {
501 return self->addCoreSubmesh(pCoreSubmesh);
502 }
503
504
CalCoreMesh_GetCoreSubmesh(CalCoreMesh * self,int id)505 CalCoreSubmesh *CalCoreMesh_GetCoreSubmesh(CalCoreMesh *self, int id)
506 {
507 return self->getCoreSubmesh(id);
508 }
509
CalCoreMesh_GetCoreSubmeshCount(CalCoreMesh * self)510 int CalCoreMesh_GetCoreSubmeshCount(CalCoreMesh *self)
511 {
512 return self->getCoreSubmeshCount();
513 }
514
515 /*
516 std::vector<CalCoreSubmesh *>& CalCoreMesh_GetVectorCoreSubmesh(CalCoreMesh *self)
517 {
518 return self->getVectorCoreSubmesh();
519 }
520 */
521
CalCoreMesh_Scale(CalCoreMesh * self,float factor)522 void CalCoreMesh_Scale(CalCoreMesh *self,float factor)
523 {
524 self->scale(factor);
525 }
526
CalCoreMesh_AddAsMorphTarget(struct CalCoreMesh * self,struct CalCoreMesh * target)527 int CalCoreMesh_AddAsMorphTarget(struct CalCoreMesh *self, struct CalCoreMesh *target)
528 {
529 return self->addAsMorphTarget(target);
530 }
531
532 //****************************************************************************//
533 // CalCoreModel wrapper functions definition //
534 //****************************************************************************//
535
CalCoreModel_AddCoreAnimation(CalCoreModel * self,CalCoreAnimation * pCoreAnimation)536 int CalCoreModel_AddCoreAnimation(CalCoreModel *self, CalCoreAnimation *pCoreAnimation)
537 {
538 return self->addCoreAnimation(pCoreAnimation);
539 }
540
CalCoreModel_AddCoreMorphAnimation(CalCoreModel * self,CalCoreMorphAnimation * pCoreMorphAnimation)541 int CalCoreModel_AddCoreMorphAnimation(CalCoreModel *self, CalCoreMorphAnimation *pCoreMorphAnimation)
542 {
543 return self->addCoreMorphAnimation(pCoreMorphAnimation);
544 }
545
CalCoreModel_AddCoreMaterial(CalCoreModel * self,CalCoreMaterial * pCoreMaterial)546 int CalCoreModel_AddCoreMaterial(CalCoreModel *self, CalCoreMaterial *pCoreMaterial)
547 {
548 return self->addCoreMaterial(pCoreMaterial);
549 }
550
CalCoreModel_AddCoreMesh(CalCoreModel * self,CalCoreMesh * pCoreMesh)551 int CalCoreModel_AddCoreMesh(CalCoreModel *self, CalCoreMesh *pCoreMesh)
552 {
553 return self->addCoreMesh(pCoreMesh);
554 }
555
CalCoreModel_CreateCoreMaterialThread(CalCoreModel * self,int coreMaterialThreadId)556 Boolean CalCoreModel_CreateCoreMaterialThread(CalCoreModel *self, int coreMaterialThreadId)
557 {
558 return self->createCoreMaterialThread(coreMaterialThreadId) ? True : False;
559 }
560
CalCoreModel_Delete(CalCoreModel * self)561 void CalCoreModel_Delete(CalCoreModel *self)
562 {
563 delete self;
564 }
565
CalCoreModel_GetCoreAnimation(CalCoreModel * self,int coreAnimationId)566 CalCoreAnimation *CalCoreModel_GetCoreAnimation(CalCoreModel *self, int coreAnimationId)
567 {
568 return self->getCoreAnimation(coreAnimationId);
569 }
570
CalCoreModel_GetCoreAnimationCount(CalCoreModel * self)571 int CalCoreModel_GetCoreAnimationCount(CalCoreModel *self)
572 {
573 return self->getCoreAnimationCount();
574 }
575
CalCoreModel_GetCoreMaterial(CalCoreModel * self,int coreMaterialId)576 CalCoreMaterial *CalCoreModel_GetCoreMaterial(CalCoreModel *self, int coreMaterialId)
577 {
578 return self->getCoreMaterial(coreMaterialId);
579 }
580
CalCoreModel_GetCoreMaterialCount(CalCoreModel * self)581 int CalCoreModel_GetCoreMaterialCount(CalCoreModel *self)
582 {
583 return self->getCoreMaterialCount();
584 }
585
CalCoreModel_GetCoreMaterialId(CalCoreModel * self,int coreMaterialThreadId,int coreMaterialSetId)586 int CalCoreModel_GetCoreMaterialId(CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId)
587 {
588 return self->getCoreMaterialId(coreMaterialThreadId, coreMaterialSetId);
589 }
590
CalCoreModel_GetCoreMesh(CalCoreModel * self,int coreMeshId)591 CalCoreMesh *CalCoreModel_GetCoreMesh(CalCoreModel *self, int coreMeshId)
592 {
593 return self->getCoreMesh(coreMeshId);
594 }
595
CalCoreModel_GetCoreMeshCount(CalCoreModel * self)596 int CalCoreModel_GetCoreMeshCount(CalCoreModel *self)
597 {
598 return self->getCoreMeshCount();
599 }
600
CalCoreModel_GetCoreSkeleton(CalCoreModel * self)601 CalCoreSkeleton *CalCoreModel_GetCoreSkeleton(CalCoreModel *self)
602 {
603 return self->getCoreSkeleton();
604 }
605
CalCoreModel_GetUserData(CalCoreModel * self)606 CalUserData CalCoreModel_GetUserData(CalCoreModel *self)
607 {
608 return self->getUserData();
609 }
610
CalCoreModel_GetCoreMorphAnimationCount(CalCoreModel * self)611 int CalCoreModel_GetCoreMorphAnimationCount(CalCoreModel *self)
612 {
613 return self->getCoreMorphAnimationCount();
614 }
615
CalCoreModel_LoadCoreAnimation(CalCoreModel * self,char * strFilename)616 int CalCoreModel_LoadCoreAnimation(CalCoreModel *self, char *strFilename)
617 {
618 return self->loadCoreAnimation(strFilename);
619 }
620
CalCoreModel_LoadCoreMaterial(CalCoreModel * self,char * strFilename)621 int CalCoreModel_LoadCoreMaterial(CalCoreModel *self, char *strFilename)
622 {
623 return self->loadCoreMaterial(strFilename);
624 }
625
CalCoreModel_LoadCoreMesh(CalCoreModel * self,char * strFilename)626 int CalCoreModel_LoadCoreMesh(CalCoreModel *self, char *strFilename)
627 {
628 return self->loadCoreMesh(strFilename);
629 }
630
CalCoreModel_LoadCoreSkeleton(CalCoreModel * self,char * strFilename)631 Boolean CalCoreModel_LoadCoreSkeleton(CalCoreModel *self, char *strFilename)
632 {
633 return self->loadCoreSkeleton(strFilename) ? True : False;
634 }
635
CalCoreModel_New(const char * name)636 CalCoreModel *CalCoreModel_New(const char* name)
637 {
638 return new CalCoreModel(name);
639 }
640
CalCoreModel_SaveCoreAnimation(CalCoreModel * self,char * strFilename,int coreAnimationId)641 Boolean CalCoreModel_SaveCoreAnimation(CalCoreModel *self, char *strFilename, int coreAnimationId)
642 {
643 return self->saveCoreAnimation(strFilename, coreAnimationId) ? True : False;
644 }
645
CalCoreModel_SaveCoreMaterial(CalCoreModel * self,char * strFilename,int coreMaterialId)646 Boolean CalCoreModel_SaveCoreMaterial(CalCoreModel *self, char *strFilename, int coreMaterialId)
647 {
648 return self->saveCoreMaterial(strFilename, coreMaterialId) ? True : False;
649 }
650
CalCoreModel_SaveCoreMesh(CalCoreModel * self,char * strFilename,int coreMeshId)651 Boolean CalCoreModel_SaveCoreMesh(CalCoreModel *self, char *strFilename, int coreMeshId)
652 {
653 return self->saveCoreMesh(strFilename, coreMeshId) ? True : False;
654 }
655
CalCoreModel_SaveCoreSkeleton(CalCoreModel * self,char * strFilename)656 Boolean CalCoreModel_SaveCoreSkeleton(CalCoreModel *self, char *strFilename)
657 {
658 return self->saveCoreSkeleton(strFilename) ? True : False;
659 }
660
CalCoreModel_SetCoreMaterialId(CalCoreModel * self,int coreMaterialThreadId,int coreMaterialSetId,int coreMaterialId)661 Boolean CalCoreModel_SetCoreMaterialId(CalCoreModel *self, int coreMaterialThreadId, int coreMaterialSetId, int coreMaterialId)
662 {
663 return self->setCoreMaterialId(coreMaterialThreadId, coreMaterialSetId, coreMaterialId) ? True : False;
664 }
665
CalCoreModel_SetCoreSkeleton(CalCoreModel * self,CalCoreSkeleton * pCoreSkeleton)666 void CalCoreModel_SetCoreSkeleton(CalCoreModel *self, CalCoreSkeleton *pCoreSkeleton)
667 {
668 self->setCoreSkeleton(pCoreSkeleton);
669 }
670
CalCoreModel_SetUserData(CalCoreModel * self,CalUserData userData)671 void CalCoreModel_SetUserData(CalCoreModel *self, CalUserData userData)
672 {
673 self->setUserData(userData);
674 }
675
676 //****************************************************************************//
677 // CalCoreSkeleton wrapper functions definition //
678 //****************************************************************************//
679
CalCoreSkeleton_AddCoreBone(CalCoreSkeleton * self,CalCoreBone * pCoreBone)680 int CalCoreSkeleton_AddCoreBone(CalCoreSkeleton *self, CalCoreBone *pCoreBone)
681 {
682 return self->addCoreBone(pCoreBone);
683 }
684
CalCoreSkeleton_CalculateState(CalCoreSkeleton * self)685 void CalCoreSkeleton_CalculateState(CalCoreSkeleton *self)
686 {
687 self->calculateState();
688 }
689
690
CalCoreSkeleton_New()691 CalCoreSkeleton *CalCoreSkeleton_New()
692 {
693 return explicitIncRef(new CalCoreSkeleton());
694 }
695
CalCoreSkeleton_Delete(CalCoreSkeleton * self)696 void CalCoreSkeleton_Delete(CalCoreSkeleton *self)
697 {
698 explicitDecRef(self);
699 }
700
CalCoreSkeleton_GetCoreBone(CalCoreSkeleton * self,int coreBoneId)701 CalCoreBone *CalCoreSkeleton_GetCoreBone(CalCoreSkeleton *self, int coreBoneId)
702 {
703 return self->getCoreBone(coreBoneId);
704 }
705
CalCoreSkeleton_GetCoreBoneId(CalCoreSkeleton * self,char * strName)706 int CalCoreSkeleton_GetCoreBoneId(CalCoreSkeleton *self, char *strName)
707 {
708 return self->getCoreBoneId(strName);
709 }
710
711 /*
712 std::list<int>& CalCoreSkeleton_GetListRootCoreBoneId(CalCoreSkeleton *self)
713 {
714 return self->getlistRootCoreBoneId();
715 }
716 */
717
718
719 /*
720 std::vector<CalCoreBone *>& CalCoreSkeleton_GetVectorCoreBone(CalCoreSkeleton *self)
721 {
722 return self->getVectorCoreBone();
723 }
724 */
725
CalCoreSkeleton_Scale(CalCoreSkeleton * self,float factor)726 void CalCoreSkeleton_Scale(CalCoreSkeleton *self,float factor)
727 {
728 self->scale(factor);
729 }
730
CalSkeleton_GetBoneBoundingBox(CalSkeleton * self,float * min,float * max)731 void CalSkeleton_GetBoneBoundingBox(CalSkeleton *self, float *min, float *max)
732 {
733 self->getBoneBoundingBox(min, max);
734 }
735
CalSkeleton_CalculateBoundingBoxes(CalSkeleton * self)736 void CalSkeleton_CalculateBoundingBoxes(CalSkeleton *self)
737 {
738 self->calculateBoundingBoxes();
739 }
740
741 //****************************************************************************//
742 // CalCoreSubmesh wrapper functions definition //
743 //****************************************************************************//
744
CalCoreSubmesh_Delete(CalCoreSubmesh * self)745 void CalCoreSubmesh_Delete(CalCoreSubmesh *self)
746 {
747 delete self;
748 }
749
CalCoreSubmesh_GetCoreMaterialThreadId(CalCoreSubmesh * self)750 int CalCoreSubmesh_GetCoreMaterialThreadId(CalCoreSubmesh *self)
751 {
752 return self->getCoreMaterialThreadId();
753 }
754
CalCoreSubmesh_GetFaceCount(CalCoreSubmesh * self)755 int CalCoreSubmesh_GetFaceCount(CalCoreSubmesh *self)
756 {
757 return self->getFaceCount();
758 }
759
CalCoreSubmesh_GetLodCount(CalCoreSubmesh * self)760 int CalCoreSubmesh_GetLodCount(CalCoreSubmesh *self)
761 {
762 return self->getLodCount();
763 }
764
CalCoreSubmesh_GetSpringCount(CalCoreSubmesh * self)765 int CalCoreSubmesh_GetSpringCount(CalCoreSubmesh *self)
766 {
767 return self->getSpringCount();
768 }
769
770 /*
771 std::vector<CalCoreSubmesh::Face>& CalCoreSubmesh_GetVectorFace(CalCoreSubmesh *self)
772 {
773 return self->getVectorFace();
774 }
775 */
776
777 /*
778 std::vector<CalCoreSubmesh::PhysicalProperty>& CalCoreSubmesh_GetVectorPhysicalProperty(CalCoreSubmesh *self)
779 {
780 return self->getVectorPhysicalProperty();
781 }
782 */
783
784 /*
785 std::vector<CalCoreSubmesh::Spring>& CalCoreSubmesh_GetVectorSpring(CalCoreSubmesh *self)
786 {
787 return self->getVectorSpring();
788 }
789 */
790
791 /*
792 std::vector<std::vector<CalCoreSubmesh::TextureCoordinate> >& CalCoreSubmesh_GetVectorVectorTextureCoordinate(CalCoreSubmesh *self)
793 {
794 return self->getVectorVectorTextureCoordinate();
795 }
796 */
797
798 /*
799 std::vector<CalCoreSubmesh::Vertex>& CalCoreSubmesh_GetVectorVertex(CalCoreSubmesh *self)
800 {
801 return self->getVectorVertex();
802 }
803 */
804
CalCoreSubmesh_GetVertexCount(CalCoreSubmesh * self)805 int CalCoreSubmesh_GetVertexCount(CalCoreSubmesh *self)
806 {
807 return self->getVertexCount();
808 }
809
CalCoreSubmesh_New()810 CalCoreSubmesh *CalCoreSubmesh_New()
811 {
812 return new CalCoreSubmesh();
813 }
814
CalCoreSubmesh_Reserve(CalCoreSubmesh * self,int vertexCount,int textureCoordinateCount,int faceCount,int springCount)815 Boolean CalCoreSubmesh_Reserve(CalCoreSubmesh *self, int vertexCount, int textureCoordinateCount, int faceCount, int springCount)
816 {
817 return self->reserve(vertexCount, textureCoordinateCount, faceCount, springCount) ? True : False;
818 }
819
CalCoreSubmesh_SetCoreMaterialThreadId(CalCoreSubmesh * self,int coreMaterialThreadId)820 void CalCoreSubmesh_SetCoreMaterialThreadId(CalCoreSubmesh *self, int coreMaterialThreadId)
821 {
822 self->setCoreMaterialThreadId(coreMaterialThreadId);
823 }
824
825 /*
826 Boolean CalCoreSubmesh_SetFace(CalCoreSubmesh *self, int faceId, CalCoreSubmesh::Face *pFace)
827 {
828 return self->setFace(faceId, *pFace) ? True : False;
829 }
830 */
831
CalCoreSubmesh_SetLodCount(CalCoreSubmesh * self,int lodCount)832 void CalCoreSubmesh_SetLodCount(CalCoreSubmesh *self, int lodCount)
833 {
834 self->setLodCount(lodCount);
835 }
836
837 /*
838 Boolean CalCoreSubmesh_SetPhysicalProperty(CalCoreSubmesh *self, int vertexId, CalCoreSubmesh::PhysicalProperty *pPhysicalProperty)
839 {
840 return self->setPhysicalProperty(vertexId, *pPhysicalProperty) ? True : False;
841 }
842 */
843
844 /*
845 Boolean CalCoreSubmesh_SetSpring(CalCoreSubmesh *self, int springId, CalCoreSubmesh::Spring *pSpring)
846 {
847 return self->setSpring(springId, *pSpring) ? True : False;
848 }
849 */
850
851 /*
852 Boolean CalCoreSubmesh_SetTextureCoordinate(CalCoreSubmesh *self, int vertexId, int textureCoordinateId, CalCoreSubmesh::TextureCoordinate *pTextureCoordinate)
853 {
854 return self->setTextureCoordinate(vertexId, textureCoordinateId, *pTextureCoordinate) ? True : False;
855 }
856 */
857
858 /*
859 Boolean CalCoreSubmesh_SetVertex(CalCoreSubmesh *self, int vertexId, CalCoreSubmesh::Vertex *pVertex)
860 {
861 return self->setVertex(vertexId, *pVertex) ? True : False;
862 }
863 */
864
CalCoreSubmesh_IsTangentsEnabled(CalCoreSubmesh * self,int mapId)865 Boolean CalCoreSubmesh_IsTangentsEnabled(CalCoreSubmesh *self, int mapId)
866 {
867 return self->isTangentsEnabled(mapId) ? True : False;
868 }
869
CalCoreSubmesh_EnableTangents(CalCoreSubmesh * self,int mapId,bool enabled)870 Boolean CalCoreSubmesh_EnableTangents(CalCoreSubmesh *self, int mapId, bool enabled)
871 {
872 return self->enableTangents(mapId, enabled) ? True : False;
873 }
874
875 //****************************************************************************//
876 // CalError wrapper functions definition //
877 //****************************************************************************//
878
CalError_GetLastErrorCode()879 CalErrorCode CalError_GetLastErrorCode()
880 {
881 return (CalErrorCode)CalError::getLastErrorCode();
882 }
883
CalError_GetLastErrorDescription()884 char *CalError_GetLastErrorDescription()
885 {
886 static std::string strDescription;
887 strDescription = CalError::getLastErrorDescription();
888
889 return const_cast<char *>(strDescription.c_str());
890 }
891
CalError_GetLastErrorFile()892 char *CalError_GetLastErrorFile()
893 {
894 return const_cast<char *>(CalError::getLastErrorFile().c_str());
895 }
896
CalError_GetLastErrorLine()897 int CalError_GetLastErrorLine()
898 {
899 return CalError::getLastErrorLine();
900 }
901
CalError_GetLastErrorText()902 char *CalError_GetLastErrorText()
903 {
904 return const_cast<char *>(CalError::getLastErrorText().c_str());
905 }
906
CalError_PrintLastError()907 void CalError_PrintLastError()
908 {
909 CalError::printLastError();
910 }
911
CalError_SetLastError(CalErrorCode code,char * strFile,int line,char * strText)912 void CalError_SetLastError(CalErrorCode code, char *strFile, int line, char *strText)
913 {
914 CalError::setLastError((CalError::Code)code, strFile, line, strText);
915 }
916
917 //****************************************************************************//
918 // CalLoader wrapper functions definition //
919 //****************************************************************************//
920
CalLoader_Delete(CalLoader * self)921 void CalLoader_Delete(CalLoader *self)
922 {
923 delete self;
924 }
925
CalLoader_LoadCoreAnimation(CalLoader * self,char * strFilename)926 CalCoreAnimation *CalLoader_LoadCoreAnimation(CalLoader *self, char *strFilename)
927 {
928 return explicitIncRef(self->loadCoreAnimation(strFilename).get());
929 }
930
CalLoader_LoadCoreMaterial(CalLoader * self,char * strFilename)931 CalCoreMaterial *CalLoader_LoadCoreMaterial(CalLoader *self, char *strFilename)
932 {
933 return explicitIncRef(self->loadCoreMaterial(strFilename).get());
934 }
935
CalLoader_LoadCoreMesh(CalLoader * self,char * strFilename)936 CalCoreMesh *CalLoader_LoadCoreMesh(CalLoader *self, char *strFilename)
937 {
938 return explicitIncRef(self->loadCoreMesh(strFilename).get());
939 }
940
CalLoader_LoadCoreSkeleton(CalLoader * self,char * strFilename)941 CalCoreSkeleton *CalLoader_LoadCoreSkeleton(CalLoader *self, char *strFilename)
942 {
943 return explicitIncRef(self->loadCoreSkeleton(strFilename).get());
944 }
945
CalLoader_New()946 CalLoader *CalLoader_New()
947 {
948 return new CalLoader();
949 }
950
951 //****************************************************************************//
952 // CalMesh wrapper functions definition //
953 //****************************************************************************//
954
CalMesh_Delete(CalMesh * self)955 void CalMesh_Delete(CalMesh *self)
956 {
957 delete self;
958 }
959
CalMesh_GetCoreMesh(CalMesh * self)960 CalCoreMesh *CalMesh_GetCoreMesh(CalMesh *self)
961 {
962 return self->getCoreMesh();
963 }
964
CalMesh_GetSubmesh(CalMesh * self,int id)965 CalSubmesh *CalMesh_GetSubmesh(CalMesh *self, int id)
966 {
967 return self->getSubmesh(id);
968 }
969
CalMesh_GetSubmeshCount(CalMesh * self)970 int CalMesh_GetSubmeshCount(CalMesh *self)
971 {
972 return self->getSubmeshCount();
973 }
974
975 /*
976 std::vector<CalSubmesh *>& CalMesh_GetVectorSubmesh(CalMesh *self)
977 {
978 return self->getVectorSubmesh();
979 }
980 */
981
CalMesh_New(CalCoreMesh * pCoreMesh)982 CalMesh *CalMesh_New(CalCoreMesh *pCoreMesh)
983 {
984 return new CalMesh(pCoreMesh);
985 }
986
CalMesh_SetLodLevel(CalMesh * self,float lodLevel)987 void CalMesh_SetLodLevel(CalMesh *self, float lodLevel)
988 {
989 self->setLodLevel(lodLevel);
990 }
991
CalMesh_SetMaterialSet(CalMesh * self,int setId)992 void CalMesh_SetMaterialSet(CalMesh *self, int setId)
993 {
994 self->setMaterialSet(setId);
995 }
996
CalMesh_SetModel(CalMesh * self,CalModel * pModel)997 void CalMesh_SetModel(CalMesh *self, CalModel *pModel)
998 {
999 self->setModel(pModel);
1000 }
1001
1002 //****************************************************************************//
1003 // CalMixer wrapper functions definition //
1004 //****************************************************************************//
1005
CalMixer_BlendCycle(CalMixer * self,int id,float weight,float delay)1006 Boolean CalMixer_BlendCycle(CalMixer *self, int id, float weight, float delay)
1007 {
1008 return self->blendCycle(id, weight, delay) ? True : False;
1009 }
1010
CalMixer_ClearCycle(CalMixer * self,int id,float delay)1011 Boolean CalMixer_ClearCycle(CalMixer *self, int id, float delay)
1012 {
1013 return self->clearCycle(id, delay) ? True : False;
1014 }
1015
CalMixer_Delete(CalMixer * self)1016 void CalMixer_Delete(CalMixer *self)
1017 {
1018 delete self;
1019 }
1020
CalMixer_ExecuteAction(CalMixer * self,int id,float delayIn,float delayOut,enum Boolean autoLock)1021 Boolean CalMixer_ExecuteAction(CalMixer *self, int id, float delayIn, float delayOut, enum Boolean autoLock)
1022 {
1023 return self->executeAction(id, delayIn, delayOut, 1.0f, autoLock == True ? true : false) ? True : False;
1024 }
1025
CalMixer_New(CalModel * pModel)1026 CalMixer *CalMixer_New(CalModel* pModel)
1027 {
1028 return new CalMixer(pModel);
1029 }
1030
CalMixer_UpdateAnimation(CalMixer * self,float deltaTime)1031 void CalMixer_UpdateAnimation(CalMixer *self, float deltaTime)
1032 {
1033 self->updateAnimation(deltaTime);
1034 }
1035
CalMixer_UpdateSkeleton(CalMixer * self)1036 void CalMixer_UpdateSkeleton(CalMixer *self)
1037 {
1038 self->updateSkeleton();
1039 }
1040
CalMixer_RemoveAction(CalMixer * self,int id)1041 void CalMixer_RemoveAction(CalMixer *self,int id)
1042 {
1043 self->removeAction(id);
1044 }
1045
1046 //****************************************************************************//
1047 // CalMorphTargetMixer wrapper functions definition //
1048 //****************************************************************************//
1049
CalMorphTargetMixer_Blend(struct CalMorphTargetMixer * self,int id,float weight,float delay)1050 Boolean CalMorphTargetMixer_Blend(struct CalMorphTargetMixer *self, int id, float weight, float delay)
1051 {
1052 return self->blend(id, weight, delay) ? True : False;
1053 }
1054
CalMorphTargetMixer_Clear(struct CalMorphTargetMixer * self,int id,float delay)1055 Boolean CalMorphTargetMixer_Clear(struct CalMorphTargetMixer *self, int id, float delay)
1056 {
1057 return self->clear(id, delay) ? True : False;
1058 }
1059
CalMorphTargetMixer_Delete(struct CalMorphTargetMixer * self)1060 void CalMorphTargetMixer_Delete(struct CalMorphTargetMixer *self)
1061 {
1062 delete self;
1063 }
1064
CalMorphTargetMixer_New(struct CalModel * pModel)1065 struct CalMorphTargetMixer *CalMorphTargetMixer_New(struct CalModel *pModel)
1066 {
1067 return new CalMorphTargetMixer(pModel);
1068 }
1069
CalMorphTargetMixer_Update(struct CalMorphTargetMixer * self,float deltaTime)1070 void CalMorphTargetMixer_Update(struct CalMorphTargetMixer *self, float deltaTime)
1071 {
1072 self->update(deltaTime);
1073 }
1074
CalMorphTargetMixer_GetMorphTargetCount(struct CalMorphTargetMixer * self)1075 int CalMorphTargetMixer_GetMorphTargetCount(struct CalMorphTargetMixer *self)
1076 {
1077 return self->getMorphTargetCount();
1078 }
1079
1080 //****************************************************************************//
1081 // CalModel wrapper functions definition //
1082 //****************************************************************************//
1083
CalModel_AttachMesh(CalModel * self,int coreMeshId)1084 Boolean CalModel_AttachMesh(CalModel *self, int coreMeshId)
1085 {
1086 return self->attachMesh(coreMeshId) ? True : False;
1087 }
1088
CalModel_Delete(CalModel * self)1089 void CalModel_Delete(CalModel *self)
1090 {
1091 delete self;
1092 }
1093
CalModel_DetachMesh(CalModel * self,int coreMeshId)1094 Boolean CalModel_DetachMesh(CalModel *self, int coreMeshId)
1095 {
1096 return self->detachMesh(coreMeshId) ? True : False;
1097 }
1098
CalModel_GetCoreModel(CalModel * self)1099 CalCoreModel *CalModel_GetCoreModel(CalModel *self)
1100 {
1101 return self->getCoreModel();
1102 }
1103
CalModel_GetMesh(CalModel * self,int coreMeshId)1104 CalMesh *CalModel_GetMesh(CalModel *self, int coreMeshId)
1105 {
1106 return self->getMesh(coreMeshId);
1107 }
1108
CalModel_GetMixer(CalModel * self)1109 CalMixer *CalModel_GetMixer(CalModel *self)
1110 {
1111 return self->getMixer();
1112 }
1113
CalModel_GetMorphTargetMixer(CalModel * self)1114 CalMorphTargetMixer *CalModel_GetMorphTargetMixer(CalModel *self)
1115 {
1116 return self->getMorphTargetMixer();
1117 }
1118
CalModel_GetPhysique(CalModel * self)1119 CalPhysique *CalModel_GetPhysique(CalModel *self)
1120 {
1121 return self->getPhysique();
1122 }
1123
CalModel_GetRenderer(CalModel * self)1124 CalRenderer *CalModel_GetRenderer(CalModel *self)
1125 {
1126 return self->getRenderer();
1127 }
1128
CalModel_GetSkeleton(CalModel * self)1129 CalSkeleton *CalModel_GetSkeleton(CalModel *self)
1130 {
1131 return self->getSkeleton();
1132 }
1133
CalModel_GetSpringSystem(CalModel * self)1134 CalSpringSystem *CalModel_GetSpringSystem(CalModel *self)
1135 {
1136 return self->getSpringSystem();
1137 }
1138
CalModel_GetUserData(CalModel * self)1139 CalUserData CalModel_GetUserData(CalModel *self)
1140 {
1141 return self->getUserData();
1142 }
1143
1144 /*
1145 std::vector<CalMesh *>& CalModel_GetVectorMesh(CalModel *self)
1146 {
1147 return self->getVectorMesh();
1148 }
1149 */
1150
CalModel_New(CalCoreModel * pCoreModel)1151 CalModel *CalModel_New(CalCoreModel* pCoreModel)
1152 {
1153 return new CalModel(pCoreModel);
1154 }
1155
CalModel_SetLodLevel(CalModel * self,float lodLevel)1156 void CalModel_SetLodLevel(CalModel *self, float lodLevel)
1157 {
1158 self->setLodLevel(lodLevel);
1159 }
1160
CalModel_SetMaterialSet(CalModel * self,int setId)1161 void CalModel_SetMaterialSet(CalModel *self, int setId)
1162 {
1163 self->setMaterialSet(setId);
1164 }
1165
CalModel_SetUserData(CalModel * self,CalUserData userData)1166 void CalModel_SetUserData(CalModel *self, CalUserData userData)
1167 {
1168 self->setUserData(userData);
1169 }
1170
CalModel_Update(CalModel * self,float deltaTime)1171 void CalModel_Update(CalModel *self, float deltaTime)
1172 {
1173 self->update(deltaTime);
1174 }
1175
1176 //****************************************************************************//
1177 // CalPhysique wrapper functions definition //
1178 //****************************************************************************//
1179
CalPhysique_CalculateNormals(CalPhysique * self,CalSubmesh * pSubmesh,float * pNormalBuffer)1180 int CalPhysique_CalculateNormals(CalPhysique *self, CalSubmesh *pSubmesh, float *pNormalBuffer)
1181 {
1182 return self->calculateNormals(pSubmesh, pNormalBuffer);
1183 }
1184
CalPhysique_CalculateVertices(CalPhysique * self,CalSubmesh * pSubmesh,float * pVertexBuffer)1185 int CalPhysique_CalculateVertices(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer)
1186 {
1187 return self->calculateVertices(pSubmesh, pVertexBuffer);
1188 }
1189
CalPhysique_CalculateVerticesAndNormals(CalPhysique * self,CalSubmesh * pSubmesh,float * pVertexBuffer)1190 int CalPhysique_CalculateVerticesAndNormals(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer)
1191 {
1192 return self->calculateVerticesAndNormals(pSubmesh, pVertexBuffer);
1193 }
1194
CalPhysique_CalculateVerticesNormalsAndTexCoords(CalPhysique * self,CalSubmesh * pSubmesh,float * pVertexBuffer,int NumTexCoords)1195 int CalPhysique_CalculateVerticesNormalsAndTexCoords(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer, int NumTexCoords)
1196 {
1197 return self->calculateVerticesNormalsAndTexCoords(pSubmesh, pVertexBuffer, NumTexCoords);
1198 }
1199
CalPhysique_CalculateTangentSpaces(CalPhysique * self,CalSubmesh * pSubmesh,int mapId,float * pTangentSpaceBuffer)1200 int CalPhysique_CalculateTangentSpaces(CalPhysique *self, CalSubmesh *pSubmesh, int mapId, float *pTangentSpaceBuffer)
1201 {
1202 return self->calculateTangentSpaces(pSubmesh, mapId, pTangentSpaceBuffer);
1203 }
1204
CalPhysique_Delete(CalPhysique * self)1205 void CalPhysique_Delete(CalPhysique *self)
1206 {
1207 delete self;
1208 }
1209
CalPhysique_New(CalModel * pModel)1210 CalPhysique *CalPhysique_New(CalModel* pModel)
1211 {
1212 return new CalPhysique(pModel);
1213 }
1214
CalPhysique_Update(CalPhysique * self)1215 void CalPhysique_Update(CalPhysique *self)
1216 {
1217 self->update();
1218 }
1219
1220 //****************************************************************************//
1221 // CalPlatform wrapper functions definition //
1222 //****************************************************************************//
1223
1224 //****************************************************************************//
1225 // CalQuaternion wrapper functions definition //
1226 //****************************************************************************//
1227
CalQuaternion_Blend(CalQuaternion * self,float d,CalQuaternion * pQ)1228 void CalQuaternion_Blend(CalQuaternion *self, float d, CalQuaternion *pQ)
1229 {
1230 self->blend(d, *pQ);
1231 }
1232
CalQuaternion_Clear(CalQuaternion * self)1233 void CalQuaternion_Clear(CalQuaternion *self)
1234 {
1235 self->clear();
1236 }
1237
CalQuaternion_Conjugate(CalQuaternion * self)1238 void CalQuaternion_Conjugate(CalQuaternion *self)
1239 {
1240 self->conjugate();
1241 }
1242
CalQuaternion_Delete(CalQuaternion * self)1243 void CalQuaternion_Delete(CalQuaternion *self)
1244 {
1245 delete self;
1246 }
1247
CalQuaternion_Equal(CalQuaternion * self,CalQuaternion * pQ)1248 void CalQuaternion_Equal(CalQuaternion *self, CalQuaternion *pQ)
1249 {
1250 *self = *pQ;
1251 }
1252
CalQuaternion_Get(CalQuaternion * self)1253 float *CalQuaternion_Get(CalQuaternion *self)
1254 {
1255 return &(self->x);
1256 }
1257
CalQuaternion_Multiply(CalQuaternion * self,CalQuaternion * pQ)1258 void CalQuaternion_Multiply(CalQuaternion *self, CalQuaternion *pQ)
1259 {
1260 *self *= *pQ;
1261 }
1262
CalQuaternion_MultiplyVector(CalQuaternion * self,CalVector * pV)1263 void CalQuaternion_MultiplyVector(CalQuaternion *self, CalVector *pV)
1264 {
1265 *self *= *pV;
1266 }
1267
CalQuaternion_New()1268 CalQuaternion *CalQuaternion_New()
1269 {
1270 return new CalQuaternion();
1271 }
1272
CalQuaternion_Op_Multiply(CalQuaternion * pResult,CalQuaternion * pQ,CalQuaternion * pR)1273 void CalQuaternion_Op_Multiply(CalQuaternion *pResult, CalQuaternion *pQ, CalQuaternion *pR)
1274 {
1275 *pResult = *pQ * *pR;
1276 }
1277
CalQuaternion_Set(CalQuaternion * self,float qx,float qy,float qz,float qw)1278 void CalQuaternion_Set(CalQuaternion *self, float qx, float qy, float qz, float qw)
1279 {
1280 self->set(qx, qy, qz, qw);
1281 }
1282
1283 //****************************************************************************//
1284 // CalRender wrapper functions definition //
1285 //****************************************************************************//
1286
CalRenderer_BeginRendering(CalRenderer * self)1287 Boolean CalRenderer_BeginRendering(CalRenderer *self)
1288 {
1289 return self->beginRendering() ? True : False;
1290 }
1291
CalRenderer_Delete(CalRenderer * self)1292 void CalRenderer_Delete(CalRenderer *self)
1293 {
1294 delete self;
1295 }
1296
CalRenderer_EndRendering(CalRenderer * self)1297 void CalRenderer_EndRendering(CalRenderer *self)
1298 {
1299 self->endRendering();
1300 }
1301
CalRenderer_GetAmbientColor(CalRenderer * self,unsigned char * pColorBuffer)1302 void CalRenderer_GetAmbientColor(CalRenderer *self, unsigned char *pColorBuffer)
1303 {
1304 self->getAmbientColor(pColorBuffer);
1305 }
1306
CalRenderer_GetDiffuseColor(CalRenderer * self,unsigned char * pColorBuffer)1307 void CalRenderer_GetDiffuseColor(CalRenderer *self, unsigned char *pColorBuffer)
1308 {
1309 self->getDiffuseColor(pColorBuffer);
1310 }
1311
CalRenderer_GetFaceCount(CalRenderer * self)1312 int CalRenderer_GetFaceCount(CalRenderer *self)
1313 {
1314 return self->getFaceCount();
1315 }
1316
CalRenderer_GetFaces(CalRenderer * self,CalIndex * pFaceBuffer)1317 int CalRenderer_GetFaces(CalRenderer *self, CalIndex *pFaceBuffer)
1318 {
1319 return self->getFaces(pFaceBuffer);
1320 }
1321
CalRenderer_GetMapCount(CalRenderer * self)1322 int CalRenderer_GetMapCount(CalRenderer *self)
1323 {
1324 return self->getMapCount();
1325 }
1326
CalRenderer_GetMapUserData(CalRenderer * self,int mapId)1327 CalUserData CalRenderer_GetMapUserData(CalRenderer *self, int mapId)
1328 {
1329 return (CalUserData)self->getMapUserData(mapId);
1330 }
1331
CalRenderer_GetMeshCount(CalRenderer * self)1332 int CalRenderer_GetMeshCount(CalRenderer *self)
1333 {
1334 return self->getMeshCount();
1335 }
1336
CalRenderer_GetNormals(CalRenderer * self,float * pNormalBuffer)1337 int CalRenderer_GetNormals(CalRenderer *self, float *pNormalBuffer)
1338 {
1339 return self->getNormals(pNormalBuffer);
1340 }
1341
CalRenderer_GetShininess(CalRenderer * self)1342 float CalRenderer_GetShininess(CalRenderer *self)
1343 {
1344 return self->getShininess();
1345 }
1346
CalRenderer_GetSpecularColor(CalRenderer * self,unsigned char * pColorBuffer)1347 void CalRenderer_GetSpecularColor(CalRenderer *self, unsigned char *pColorBuffer)
1348 {
1349 self->getSpecularColor(pColorBuffer);
1350 }
1351
CalRenderer_GetSubmeshCount(CalRenderer * self,int meshId)1352 int CalRenderer_GetSubmeshCount(CalRenderer *self, int meshId)
1353 {
1354 return self->getSubmeshCount(meshId);
1355 }
1356
CalRenderer_GetTextureCoordinates(CalRenderer * self,int mapId,float * pTextureCoordinateBuffer)1357 int CalRenderer_GetTextureCoordinates(CalRenderer *self, int mapId, float *pTextureCoordinateBuffer)
1358 {
1359 return self->getTextureCoordinates(mapId, pTextureCoordinateBuffer);
1360 }
1361
CalRenderer_GetVertexCount(CalRenderer * self)1362 int CalRenderer_GetVertexCount(CalRenderer *self)
1363 {
1364 return self->getVertexCount();
1365 }
1366
CalRenderer_GetVertices(CalRenderer * self,float * pVertexBuffer)1367 int CalRenderer_GetVertices(CalRenderer *self, float *pVertexBuffer)
1368 {
1369 return self->getVertices(pVertexBuffer);
1370 }
1371
CalRenderer_GetVerticesAndNormals(CalRenderer * self,float * pVertexBuffer)1372 int CalRenderer_GetVerticesAndNormals(CalRenderer *self, float *pVertexBuffer)
1373 {
1374 return self->getVerticesAndNormals(pVertexBuffer);
1375 }
1376
CalRenderer_GetVerticesNormalsAndTexCoords(CalRenderer * self,float * pVertexBuffer,int NumTexCoords)1377 int CalRenderer_GetVerticesNormalsAndTexCoords(CalRenderer *self, float *pVertexBuffer, int NumTexCoords)
1378 {
1379 return self->getVerticesNormalsAndTexCoords(pVertexBuffer,NumTexCoords);
1380 }
1381
CalRenderer_GetTangentSpaces(CalRenderer * self,int mapId,float * pTangentSpaceBuffer)1382 int CalRenderer_GetTangentSpaces(CalRenderer *self, int mapId, float *pTangentSpaceBuffer)
1383 {
1384 return self->getTangentSpaces(mapId, pTangentSpaceBuffer);
1385 }
1386
CalRenderer_IsTangentsEnabled(CalRenderer * self,int mapId)1387 Boolean CalRenderer_IsTangentsEnabled(CalRenderer *self, int mapId)
1388 {
1389 return self->isTangentsEnabled(mapId) ? True : False;
1390 }
1391
CalRenderer_New(CalModel * pModel)1392 CalRenderer *CalRenderer_New(CalModel* pModel)
1393 {
1394 return new CalRenderer(pModel);
1395 }
1396
CalRenderer_SelectMeshSubmesh(CalRenderer * self,int meshId,int submeshId)1397 Boolean CalRenderer_SelectMeshSubmesh(CalRenderer *self, int meshId, int submeshId)
1398 {
1399 return self->selectMeshSubmesh(meshId, submeshId) ? True : False;
1400 }
1401
1402 //****************************************************************************//
1403 // CalPlatform wrapper functions definition //
1404 //****************************************************************************//
1405
CalSaver_Delete(CalSaver * self)1406 void CalSaver_Delete(CalSaver *self)
1407 {
1408 delete self;
1409 }
1410
CalSaver_New()1411 CalSaver *CalSaver_New()
1412 {
1413 return new CalSaver();
1414 }
1415
CalSaver_SaveCoreAnimation(CalSaver * self,char * strFilename,CalCoreAnimation * pCoreAnimation)1416 Boolean CalSaver_SaveCoreAnimation(CalSaver *self, char *strFilename, CalCoreAnimation *pCoreAnimation)
1417 {
1418 return self->saveCoreAnimation(strFilename, pCoreAnimation) ? True : False;
1419 }
1420
CalSaver_SaveCoreMaterial(CalSaver * self,char * strFilename,CalCoreMaterial * pCoreMaterial)1421 Boolean CalSaver_SaveCoreMaterial(CalSaver *self, char *strFilename, CalCoreMaterial *pCoreMaterial)
1422 {
1423 return self->saveCoreMaterial(strFilename, pCoreMaterial) ? True : False;
1424 }
1425
CalSaver_SaveCoreMesh(CalSaver * self,char * strFilename,CalCoreMesh * pCoreMesh)1426 Boolean CalSaver_SaveCoreMesh(CalSaver *self, char *strFilename, CalCoreMesh *pCoreMesh)
1427 {
1428 return self->saveCoreMesh(strFilename, pCoreMesh) ? True : False;
1429 }
1430
CalSaver_SaveCoreSkeleton(CalSaver * self,char * strFilename,CalCoreSkeleton * pCoreSkeleton)1431 Boolean CalSaver_SaveCoreSkeleton(CalSaver *self, char *strFilename, CalCoreSkeleton *pCoreSkeleton)
1432 {
1433 return self->saveCoreSkeleton(strFilename, pCoreSkeleton) ? True : False;
1434 }
1435
1436 //****************************************************************************//
1437 // CalSkeleton wrapper functions definition //
1438 //****************************************************************************//
1439
CalSkeleton_CalculateState(CalSkeleton * self)1440 void CalSkeleton_CalculateState(CalSkeleton *self)
1441 {
1442 self->calculateState();
1443 }
1444
CalSkeleton_ClearState(CalSkeleton * self)1445 void CalSkeleton_ClearState(CalSkeleton *self)
1446 {
1447 self->clearState();
1448 }
1449
CalSkeleton_Delete(CalSkeleton * self)1450 void CalSkeleton_Delete(CalSkeleton *self)
1451 {
1452 delete self;
1453 }
1454
CalSkeleton_GetBone(CalSkeleton * self,int boneId)1455 CalBone *CalSkeleton_GetBone(CalSkeleton *self, int boneId)
1456 {
1457 return self->getBone(boneId);
1458 }
1459
CalSkeleton_GetCoreSkeleton(CalSkeleton * self)1460 CalCoreSkeleton *CalSkeleton_GetCoreSkeleton(CalSkeleton *self)
1461 {
1462 return self->getCoreSkeleton();
1463 }
1464
1465 /*
1466 std::vector<CalBone *>& CalSkeleton_GetVectorBone(CalSkeleton *self)
1467 {
1468 return self->getVectorBone();
1469 }
1470 */
1471
CalSkeleton_LockState(CalSkeleton * self)1472 void CalSkeleton_LockState(CalSkeleton *self)
1473 {
1474 self->lockState();
1475 }
1476
CalSkeleton_New(CalCoreSkeleton * pCoreSkeleton)1477 CalSkeleton *CalSkeleton_New(CalCoreSkeleton *pCoreSkeleton)
1478 {
1479 return new CalSkeleton(pCoreSkeleton);
1480 }
1481
1482 // DEBUG-CODE
CalSkeleton_GetBonePoints(CalSkeleton * self,float * pPoints)1483 int CalSkeleton_GetBonePoints(CalSkeleton *self, float *pPoints)
1484 {
1485 return self->getBonePoints(pPoints);
1486 }
1487
1488 // DEBUG-CODE
CalSkeleton_GetBonePointsStatic(CalSkeleton * self,float * pPoints)1489 int CalSkeleton_GetBonePointsStatic(CalSkeleton *self, float *pPoints)
1490 {
1491 return self->getBonePointsStatic(pPoints);
1492 }
1493
1494 // DEBUG-CODE
CalSkeleton_GetBoneLines(CalSkeleton * self,float * pLines)1495 int CalSkeleton_GetBoneLines(CalSkeleton *self, float *pLines)
1496 {
1497 return self->getBoneLines(pLines);
1498 }
1499
1500 // DEBUG-CODE
CalSkeleton_GetBoneLinesStatic(CalSkeleton * self,float * pLines)1501 int CalSkeleton_GetBoneLinesStatic(CalSkeleton *self, float *pLines)
1502 {
1503 return self->getBoneLinesStatic(pLines);
1504 }
1505
1506 //****************************************************************************//
1507 // CalSpringSystem wrapper functions definition //
1508 //****************************************************************************//
1509
CalSpringSystem_CalculateForces(CalSpringSystem * self,CalSubmesh * pSubmesh,float deltaTime)1510 void CalSpringSystem_CalculateForces(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime)
1511 {
1512 self->calculateForces(pSubmesh, deltaTime);
1513 }
1514
CalSpringSystem_CalculateVertices(CalSpringSystem * self,CalSubmesh * pSubmesh,float deltaTime)1515 void CalSpringSystem_CalculateVertices(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime)
1516 {
1517 self->calculateVertices(pSubmesh, deltaTime);
1518 }
1519
CalSpringSystem_Delete(CalSpringSystem * self)1520 void CalSpringSystem_Delete(CalSpringSystem *self)
1521 {
1522 delete self;
1523 }
1524
CalSpringSystem_New(CalModel * pModel)1525 CalSpringSystem *CalSpringSystem_New(CalModel* pModel)
1526 {
1527 return new CalSpringSystem(pModel);
1528 }
1529
CalSpringSystem_Update(CalSpringSystem * self,float deltaTime)1530 void CalSpringSystem_Update(CalSpringSystem *self, float deltaTime)
1531 {
1532 self->update(deltaTime);
1533 }
1534
1535 //****************************************************************************//
1536 // CalSubmesh wrapper functions definition //
1537 //****************************************************************************//
1538
CalSubmesh_Delete(CalSubmesh * self)1539 void CalSubmesh_Delete(CalSubmesh *self)
1540 {
1541 delete self;
1542 }
1543
CalSubmesh_GetCoreSubmesh(CalSubmesh * self)1544 CalCoreSubmesh *CalSubmesh_GetCoreSubmesh(CalSubmesh *self)
1545 {
1546 return self->getCoreSubmesh();
1547 }
1548
CalSubmesh_GetCoreMaterialId(CalSubmesh * self)1549 int CalSubmesh_GetCoreMaterialId(CalSubmesh *self)
1550 {
1551 return self->getCoreMaterialId();
1552 }
1553
CalSubmesh_GetFaceCount(CalSubmesh * self)1554 int CalSubmesh_GetFaceCount(CalSubmesh *self)
1555 {
1556 return self->getFaceCount();
1557 }
1558
CalSubmesh_GetFaces(CalSubmesh * self,CalIndex * pFaceBuffer)1559 int CalSubmesh_GetFaces(CalSubmesh *self, CalIndex *pFaceBuffer)
1560 {
1561 return self->getFaces(pFaceBuffer);
1562 }
1563
1564 /*
1565 std::vector<CalVector>& CalSubmesh_GetVectorNormal(CalSubmesh *self)
1566 {
1567 return self->getVectorNormal();
1568 }
1569 */
1570 /*
1571 std::vector<CalSubmesh::PhysicalProperty>& CalSubmesh_GetVectorPhysicalProperty(CalSubmesh *self)
1572 {
1573 return self->getVectorPhysicalProperty();
1574 }
1575 */
1576
1577 /*
1578 std::vector<CalVector>& CalSubmesh_GetVectorVertex(CalSubmesh *self)
1579 {
1580 return self->getVectorVertex();
1581 }
1582 */
1583
CalSubmesh_GetVertexCount(CalSubmesh * self)1584 int CalSubmesh_GetVertexCount(CalSubmesh *self)
1585 {
1586 return self->getVertexCount();
1587 }
1588
CalSubmesh_HasInternalData(CalSubmesh * self)1589 Boolean CalSubmesh_HasInternalData(CalSubmesh *self)
1590 {
1591 return self->hasInternalData() ? True : False;
1592 }
1593
CalSubmesh_New(CalCoreSubmesh * coreSubmesh)1594 CalSubmesh *CalSubmesh_New(CalCoreSubmesh* coreSubmesh)
1595 {
1596 return new CalSubmesh(coreSubmesh);
1597 }
1598
CalSubmesh_SetCoreMaterialId(CalSubmesh * self,int coreMaterialId)1599 void CalSubmesh_SetCoreMaterialId(CalSubmesh *self, int coreMaterialId)
1600 {
1601 self->setCoreMaterialId(coreMaterialId);
1602 }
1603
CalSubmesh_SetLodLevel(CalSubmesh * self,float lodLevel)1604 void CalSubmesh_SetLodLevel(CalSubmesh *self, float lodLevel)
1605 {
1606 self->setLodLevel(lodLevel);
1607 }
1608
1609 //****************************************************************************//
1610 // CalVector wrapper functions definition //
1611 //****************************************************************************//
1612
CalVector_Add(CalVector * self,CalVector * pV)1613 void CalVector_Add(CalVector *self, CalVector *pV)
1614 {
1615 *self += *pV;
1616 }
1617
CalVector_Blend(CalVector * self,float d,CalVector * pV)1618 void CalVector_Blend(CalVector *self, float d, CalVector *pV)
1619 {
1620 self->blend(d, *pV);
1621 }
1622
CalVector_Clear(CalVector * self)1623 void CalVector_Clear(CalVector *self)
1624 {
1625 self->clear();
1626 }
1627
CalVector_Delete(CalVector * self)1628 void CalVector_Delete(CalVector *self)
1629 {
1630 delete self;
1631 }
1632
CalVector_Equal(CalVector * self,CalVector * pV)1633 void CalVector_Equal(CalVector *self, CalVector *pV)
1634 {
1635 *self = *pV;
1636 }
1637
CalVector_InverseScale(CalVector * self,float d)1638 void CalVector_InverseScale(CalVector *self, float d)
1639 {
1640 *self /= d;
1641 }
1642
CalVector_Get(CalVector * self)1643 float *CalVector_Get(CalVector *self)
1644 {
1645 return &(self->x);
1646 }
1647
CalVector_Length(CalVector * self)1648 float CalVector_Length(CalVector *self)
1649 {
1650 return self->length();
1651 }
1652
CalVector_New()1653 CalVector *CalVector_New()
1654 {
1655 return new CalVector();
1656 }
1657
CalVector_Normalize(CalVector * self)1658 float CalVector_Normalize(CalVector *self)
1659 {
1660 return self->normalize();
1661 }
1662
CalVector_Op_Add(CalVector * pResult,CalVector * pV,CalVector * pU)1663 void CalVector_Op_Add(CalVector *pResult, CalVector *pV, CalVector *pU)
1664 {
1665 *pResult = *pV + *pU;
1666 }
1667
CalVector_Op_Subtract(CalVector * pResult,CalVector * pV,CalVector * pU)1668 void CalVector_Op_Subtract(CalVector *pResult, CalVector *pV, CalVector *pU)
1669 {
1670 *pResult = *pV - *pU;
1671 }
1672
CalVector_CalVector_Op_Scale(CalVector * pResult,CalVector * pV,float d)1673 void CalVector_CalVector_Op_Scale(CalVector *pResult, CalVector *pV, float d)
1674 {
1675 *pResult = *pV * d;
1676 }
1677
CalVector_CalVector_Op_InverseScale(CalVector * pResult,CalVector * pV,float d)1678 void CalVector_CalVector_Op_InverseScale(CalVector *pResult, CalVector *pV, float d)
1679 {
1680 *pResult = *pV / d;
1681 }
1682
CalVector_Op_Scalar(CalVector * pV,CalVector * pU)1683 float CalVector_Op_Scalar(CalVector *pV, CalVector *pU)
1684 {
1685 return *pV * *pU;
1686 }
1687
CalVector_Op_Cross(CalVector * pResult,CalVector * pV,CalVector * pU)1688 void CalVector_Op_Cross(CalVector *pResult, CalVector *pV, CalVector *pU)
1689 {
1690 *pResult = *pV % *pU;
1691 }
1692
CalVector_Scale(CalVector * self,float d)1693 void CalVector_Scale(CalVector *self, float d)
1694 {
1695 *self *= d;
1696 }
1697
CalVector_Set(CalVector * self,float vx,float vy,float vz)1698 void CalVector_Set(CalVector *self, float vx, float vy, float vz)
1699 {
1700 self->set(vx, vy, vz);
1701 }
1702
CalVector_Subtract(CalVector * self,CalVector * pV)1703 void CalVector_Subtract(CalVector *self, CalVector *pV)
1704 {
1705 *self = *pV;
1706 }
1707
CalVector_Transform(CalVector * self,CalQuaternion * pQ)1708 void CalVector_Transform(CalVector *self, CalQuaternion *pQ)
1709 {
1710 *self *= *pQ;
1711 }
1712
1713 //****************************************************************************//
1714