RigsofRods
Soft-body Physics Simulation
OgreAngelscript.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2024 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
25 
26 #include "Application.h"
27 #include "ScriptEngine.h"
28 #include "ScriptUtils.h"
29 
30 // AS addons start
31 #include "scriptstdstring/scriptstdstring.h"
32 #include "scriptmath/scriptmath.h"
33 #include "scriptany/scriptany.h"
34 #include "scriptarray/scriptarray.h"
35 #include "scripthelper/scripthelper.h"
36 // AS addons end
37 
38 #include <OgreRenderOperation.h>
39 
40 #include <Overlay/OgreOverlaySystem.h>
41 #include <Overlay/OgreOverlayManager.h>
42 #include <Overlay/OgreOverlay.h>
43 #include <Overlay/OgreOverlayContainer.h>
44 
45 using namespace Ogre;
46 using namespace AngelScript;
47 using namespace RoR;
48 
49 // helper/wrapper functions first
50 
51 /***VECTOR3***/
52 static void Vector3DefaultConstructor(Vector3* self)
53 {
54  new(self) Vector3();
55 }
56 
57 static void Vector3CopyConstructor(const Vector3& other, Vector3* self)
58 {
59  new(self) Vector3(other);
60 }
61 
62 static void Vector3InitConstructor(float x, float y, float z, Vector3* self)
63 {
64  new(self) Vector3(x, y, z);
65 }
66 
67 static void Vector3InitConstructorScaler(float s, Vector3* self)
68 {
69  new(self) Vector3(s, s, s);
70 }
71 
72 /***VECTOR2***/
73 static void Vector2DefaultConstructor(Vector2* self)
74 {
75  new(self) Vector2();
76 }
77 
78 static void Vector2CopyConstructor(const Vector2& other, Vector2* self)
79 {
80  new(self) Vector2(other);
81 }
82 
83 static void Vector2InitConstructor(float x, float y, Vector2* self)
84 {
85  new(self) Vector2(x, y);
86 }
87 
88 static void Vector2InitConstructorScaler(float s, Vector2* self)
89 {
90  new(self) Vector2(s, s);
91 }
92 
93 // not used
94 static int Vector3Cmp(const Vector3& a, const Vector3& b)
95 {
96  // If a is greater than b, then we return a positive number
97  if (a > b)
98  return 1;
99  // If a is smaller than b, then we return a negative number
100  else if (a < b)
101  return -1;
102  // If a is equal to b, then we return zero
103  else if (a == b)
104  return 0;
105  // Now, what are we supposed to return if none of the above is true???
106  else
107  return -2; // definitly not this, this is interpreted as 'smaller than'...
108 }
109 
110 /***RADIAN***/
111 static void RadianDefaultConstructor(Radian* self)
112 {
113  new(self) Radian();
114 }
115 
116 static void RadianCopyConstructor(const Radian& other, Radian* self)
117 {
118  new(self) Radian(other);
119 }
120 
121 static void RadianInitConstructor(float r, Radian* self)
122 {
123  new(self) Radian(r);
124 }
125 
126 static int RadianCmp(const Radian& a, const Radian& b)
127 {
128  if (a > b)
129  return 1;
130  else if (a < b)
131  return -1;
132  else
133  return 0;
134 }
135 
136 /***DEGREE***/
137 static void DegreeDefaultConstructor(Degree* self)
138 {
139  new(self) Degree();
140 }
141 
142 static void DegreeCopyConstructor(const Degree& other, Degree* self)
143 {
144  new(self) Degree(other);
145 }
146 
147 static void DegreeInitConstructor(float r, Degree* self)
148 {
149  new(self) Degree(r);
150 }
151 
152 static int DegreeCmp(const Degree& a, const Degree& b)
153 {
154  if (a > b)
155  return 1;
156  else if (a < b)
157  return -1;
158  else
159  return 0;
160 }
161 
162 /***QUATERNION***/
163 static void QuaternionDefaultConstructor(Quaternion* self)
164 {
165  new(self) Quaternion();
166 }
167 
168 static void QuaternionCopyConstructor(const Quaternion& other, Quaternion* self)
169 {
170  new(self) Quaternion(other.w, other.x, other.y, other.z);
171 }
172 
173 static void QuaternionInitConstructor1(const Radian& rfAngle, const Vector3& rkAxis, Quaternion* self)
174 {
175  new(self) Quaternion(rfAngle, rkAxis);
176 }
177 
178 static void QuaternionInitConstructor2(float w, float x, float y, float z, Quaternion* self)
179 {
180  new(self) Quaternion(w, x, y, z);
181 }
182 
183 static void QuaternionInitConstructor3(const Vector3& xaxis, const Vector3& yaxis, const Vector3& zaxis, Quaternion* self)
184 {
185  new(self) Quaternion(xaxis, yaxis, zaxis);
186 }
187 
188 // not used
189 static void QuaternionInitConstructor5(float val, Quaternion* self)
190 {
191  new(self) Quaternion((Ogre::Real *)&val);
192 }
193 
194 static void QuaternionInitConstructorScaler(float s, Quaternion* self)
195 {
196  new(self) Quaternion(s, s, s, s);
197 }
198 
199 /***COLOURVALUE***/
200 static void ColourValueDefaultConstructor(ColourValue* self)
201 {
202  new(self) ColourValue();
203 }
204 
205 static void ColourValueInitConstructor(float r, float g, float b, float a, ColourValue* self)
206 {
207  new(self) ColourValue(r,g,b,a);
208 }
209 
210 static void ColourValueCopyConstructor(const ColourValue& other, ColourValue* self)
211 {
212  new(self) ColourValue(other.r, other.g, other.b, other.a);
213 }
214 
215 /***BOX***/
216 static void BoxDefaultConstructor(Box* self)
217 {
218  new(self) Box();
219 }
220 
221 static void BoxInitConstructor(asUINT l, asUINT t, asUINT r, asUINT b, Box* self)
222 {
223  new(self) Box(l, t, r, b);
224 }
225 
226 static void BoxCopyConstructor(const Box& other, Box* self)
227 {
228  new(self) Box(other);
229 }
230 
231 static void BoxDestructor(Box* self)
232 {
233  (self)->~Box();
234 }
235 
236 static void BoxAssignOperator(const Box& other, Box* self)
237 {
238  (self)->operator=(other);
239 }
240 
241 /***TEXTURE***/
242 static void TexturePtrDefaultConstructor(TexturePtr* self)
243 {
244  new (self) TexturePtr();
245 }
246 
247 static void TexturePtrCopyConstructor(const TexturePtr& other, TexturePtr* self)
248 {
249  new (self) TexturePtr(other);
250 }
251 
252 static void TexturePtrDestructor(TexturePtr* self)
253 {
254  (self)->~TexturePtr();
255 }
256 
257 static void TexturePtrAssignOperator(const TexturePtr& other, TexturePtr* self)
258 {
259  (self)->operator=(other);
260 }
261 
262 static bool TexturePtrIsNull(TexturePtr* self)
263 {
264  return !(self)->operator bool();
265 }
266 
267 /***HARDWAREPIXELBUFFER***/
268 // NOTE: The `*SharedPtr` is a deprecated alias of `*Ptr` in OGRE 14, but it's not yet present in the version we use.
269 static void HardwarePixelBufferPtrDefaultConstructor(HardwarePixelBufferSharedPtr* self)
270 {
271  new (self) HardwarePixelBufferSharedPtr();
272 }
273 
274 static void HardwarePixelBufferPtrCopyConstructor(const HardwarePixelBufferSharedPtr& other, HardwarePixelBufferSharedPtr* self)
275 {
276  new (self) HardwarePixelBufferSharedPtr(other);
277 }
278 
279 static void HardwarePixelBufferPtrDestructor(HardwarePixelBufferSharedPtr* self)
280 {
281  (self)->~HardwarePixelBufferSharedPtr();
282 }
283 
284 static void HardwarePixelBufferPtrAssignOperator(const HardwarePixelBufferSharedPtr& other, HardwarePixelBufferSharedPtr* self)
285 {
286  (self)->operator=(other);
287 }
288 
289 /***PIXELBOX***/
290 static void PixelBoxDefaultConstructor(PixelBox* self)
291 {
292  new (self) PixelBox();
293 }
294 
295 static void PixelBoxCopyConstructor(const PixelBox& other, PixelBox* self)
296 {
297  new (self) PixelBox(other);
298 }
299 
300 static void PixelBoxDestructor(PixelBox* self)
301 {
302  (self)->~PixelBox();
303 }
304 
305 static void PixelBoxAssignOperator(const PixelBox& other, PixelBox* self)
306 {
307  (self)->operator=(other);
308 }
309 
310 /***IMAGE***/
311 static void ImageDefaultConstructor(Image* self)
312 {
313  new (self) Image();
314 }
315 
316 static void ImageCopyConstructor(const Image& other, Image* self)
317 {
318  new (self) Image(other);
319 }
320 
321 static void ImageDestructor(PixelBox* self)
322 {
323  (self)->~PixelBox();
324 }
325 
326 static void ImageAssignOperator(const PixelBox& other, PixelBox* self)
327 {
328  (self)->operator=(other);
329 }
330 
331 /***MESH***/
333 
334 static SubMeshArray* MeshPtrGetSubmeshes(const MeshPtr& self)
335 {
336  return new SubMeshArray(self->getSubMeshes());
337 }
338 
339 static void MeshPtrDefaultConstructor(MeshPtr* self)
340 {
341  new (self) MeshPtr();
342 }
343 
344 static void MeshPtrCopyConstructor(const MeshPtr& other, MeshPtr* self)
345 {
346  new (self) MeshPtr(other);
347 }
348 
349 static void MeshPtrDestructor(MeshPtr* self)
350 {
351  (self)->~MeshPtr();
352 }
353 
354 static void MeshPtrAssignOperator(const MeshPtr& other, MeshPtr* self)
355 {
356  (self)->operator=(other);
357 }
358 
359 static bool MeshPtrIsNull(MeshPtr* self)
360 {
361  return !(self)->operator bool();
362 }
363 
364 /***SUBMESH***/
365 static AngelScript::CScriptArray* SubMesh__getVertexPositions(SubMesh* self)
366 {
367  VertexData* vertData = (self->useSharedVertices) ? self->parent->sharedVertexData : self->vertexData;
368  if (!vertData)
369  {
370  App::GetScriptEngine()->SLOG("SubMesh::__getVertexPositions(): No vertex data found");
371  return nullptr;
372  }
373  const Ogre::VertexElement* posElem = vertData->vertexDeclaration->findElementBySemantic(Ogre::VES_POSITION);
374  if (!posElem)
375  {
376  App::GetScriptEngine()->SLOG("SubMesh::__getVertexPositions(): No POSITION element found");
377  return nullptr;
378  }
379  Ogre::HardwareVertexBufferSharedPtr vbuf = vertData->vertexBufferBinding->getBuffer(posElem->getSource());
380  if (!vbuf)
381  {
382  App::GetScriptEngine()->SLOG("SubMesh::__getVertexPositions(): No vertex buffer found");
383  return nullptr;
384  }
385  AngelScript::asITypeInfo* typeinfo = App::GetScriptEngine()->getEngine()->GetTypeInfoByDecl("array<vector3>");
386  AngelScript::CScriptArray* arr = AngelScript::CScriptArray::Create(typeinfo, vertData->vertexCount);
387  uint8_t* pStart = static_cast<uint8_t*>(vbuf->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
388  for (size_t i = 0; i < vertData->vertexCount; i++)
389  {
390  uint8_t* pVert = pStart + (i * vertData->vertexDeclaration->getVertexSize(posElem->getSource()));
391  float* pPos = nullptr;
392  posElem->baseVertexPointerToElement(pVert, &pPos);
393  Vector3 pos(*pPos, *(pPos+1), *(pPos+2));
394  arr->SetValue(i, &pos);
395  }
396  vbuf->unlock();
397  return arr;
398 }
399 
400 static AngelScript::CScriptArray* SubMesh__getVertexTexcoords(SubMesh* self, asUINT index)
401 {
402  VertexData* vertData = (self->useSharedVertices) ? self->parent->sharedVertexData : self->vertexData;
403  if (!vertData)
404  {
405  App::GetScriptEngine()->SLOG("SubMesh::__getVertexTexcoords(): No vertex data found");
406  return nullptr;
407  }
408  const Ogre::VertexElement* texcoordElem = vertData->vertexDeclaration->findElementBySemantic(Ogre::VES_TEXTURE_COORDINATES, (unsigned short)index);
409  if (!texcoordElem)
410  {
411  App::GetScriptEngine()->SLOG(fmt::format("SubMesh::__getVertexTexcoords(): TEXCOORD element with index {} not found", index));
412  return nullptr;
413  }
414  Ogre::HardwareVertexBufferSharedPtr vbuf = vertData->vertexBufferBinding->getBuffer(texcoordElem->getSource());
415  if (!vbuf)
416  {
417  App::GetScriptEngine()->SLOG("SubMesh::__getVertexTexcoords(): No vertex buffer found");
418  return nullptr;
419  }
420  AngelScript::asITypeInfo* typeinfo = App::GetScriptEngine()->getEngine()->GetTypeInfoByDecl("array<vector2>");
421  AngelScript::CScriptArray* arr = AngelScript::CScriptArray::Create(typeinfo, vertData->vertexCount);
422  uint8_t* pStart = static_cast<uint8_t*>(vbuf->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
423  const size_t vertSize = vertData->vertexDeclaration->getVertexSize(texcoordElem->getSource());
424  ROR_ASSERT(texcoordElem->getType() == Ogre::VET_FLOAT2);
425  for (size_t i = 0; i < vertData->vertexCount; i++)
426  {
427  uint8_t* pVert = pStart + ((i + vertData->vertexStart) * vertSize);
428  float* pTexcoord = nullptr;
429  texcoordElem->baseVertexPointerToElement(pVert, &pTexcoord);
430  Vector2 texcoord(*pTexcoord, *(pTexcoord+1));
431  arr->SetValue(i, &texcoord);
432  }
433  vbuf->unlock();
434  return arr;
435 }
436 
437 static Ogre::HardwareIndexBuffer::IndexType SubMesh__getIndexType(SubMesh* self)
438 {
439  if (!self->indexData)
440  {
441  App::GetScriptEngine()->SLOG("SubMesh::__getIndexType(): No index data found");
442  return Ogre::HardwareIndexBuffer::IT_16BIT;
443  }
444  Ogre::HardwareIndexBufferSharedPtr ibuf = self->indexData->indexBuffer;
445  if (!ibuf)
446  {
447  App::GetScriptEngine()->SLOG("SubMesh::__getIndexType(): No index buffer found");
448  return Ogre::HardwareIndexBuffer::IT_16BIT;
449  }
450  return ibuf->getType();
451 }
452 
453 static AngelScript::CScriptArray* SubMesh__getIndexBufferHelper(Ogre::SubMesh* self, Ogre::HardwareIndexBuffer::IndexType desiredType)
454 {
455  if (!self->indexData)
456  {
457  App::GetScriptEngine()->SLOG("SubMesh::__getIndexBufferHelper(): No index data found");
458  return nullptr;
459  }
460  Ogre::HardwareIndexBufferSharedPtr ibuf = self->indexData->indexBuffer;
461  if (!ibuf)
462  {
463  App::GetScriptEngine()->SLOG("SubMesh::__getIndexBufferHelper(): No index buffer found");
464  return nullptr;
465  }
466  if (ibuf->getType() != desiredType)
467  {
468  App::GetScriptEngine()->SLOG("SubMesh::__getIndexBufferHelper(): Index buffer type mismatch");
469  return nullptr;
470  }
471  AngelScript::asITypeInfo* typeinfo = App::GetScriptEngine()->getEngine()->GetTypeInfoByDecl("array<uint16>");
472  AngelScript::CScriptArray* arr = AngelScript::CScriptArray::Create(typeinfo, self->indexData->indexCount);
473  uint8_t* pStart = static_cast<uint8_t*>(ibuf->lock(Ogre::HardwareBuffer::HBL_READ_ONLY));
474  for (size_t i = self->indexData->indexStart; i < self->indexData->indexCount; i++)
475  {
476  uint8_t* pIndex = pStart + (i * ibuf->getIndexSize());
477  if (ibuf->getType() == Ogre::HardwareIndexBuffer::IT_16BIT)
478  {
479  uint16_t index = *reinterpret_cast<uint16_t*>(pIndex);
480  arr->SetValue(i, &index);
481  }
482  else if (ibuf->getType() == Ogre::HardwareIndexBuffer::IT_32BIT)
483  {
484  uint32_t index = *reinterpret_cast<uint32_t*>(pIndex);
485  arr->SetValue(i, &index);
486  }
487  else
488  {
489  App::GetScriptEngine()->SLOG("SubMesh::__getIndexBufferHelper(): Unknown index buffer type");
490  return nullptr;
491  }
492  }
493  ibuf->unlock();
494  return arr;
495 }
496 
497 /***NODE***/
499 
500 static ChildNodeArray* NodeGetChildren(Ogre::Node* self)
501 {
502  return new ChildNodeArray(self->getChildren());
503 }
504 
505 static std::string NodeGetUniqueNameMixin(Ogre::Node* self)
506 {
507  // Node names are optional and largely unused by RoR, so always append the memory address (libfmt adds the '0x' prefix)
508  return fmt::format("\"{}\" ({})", self->getName(), static_cast<void*>(self));
509 }
510 
511 /***SCENENODE***/
513 
515 {
516  return new MovableObjectArray(self->getAttachedObjects());
517 }
518 
519 /***MOVABLEOBJECT***/
520 static std::string MovableObjectGetUniqueNameMixin(Ogre::MovableObject* self)
521 {
522  // names are optional and largely unused by RoR, so always append the type and memory address (libfmt adds the '0x' prefix)
523  return fmt::format("\"{}\" ({} {})", self->getName(), self->getMovableType(), static_cast<void*>(self));
524 }
525 
526 /***ROOT***/
528 
530 {
531  return new SceneManagerInstanceDict(self->getSceneManagers());
532 }
533 
534 /***ANIMATIONSTATESET***/
536 
538 {
539  return new AnimationStateDict(self->getAnimationStates());
540 }
541 
542 /***MATERIAL***/
544 
545 static TechniqueArray* MaterialPtrGetTechniques(const MaterialPtr& self)
546 {
547  return new TechniqueArray(self->getTechniques());
548 }
549 
550 static void MaterialPtrDefaultConstructor(MaterialPtr* self)
551 {
552  new (self) MaterialPtr();
553 }
554 
555 static void MaterialPtrCopyConstructor(const MaterialPtr& other, MaterialPtr* self)
556 {
557  new (self) MaterialPtr(other);
558 }
559 
560 static void MaterialPtrDestructor(MaterialPtr* self)
561 {
562  (self)->~MaterialPtr();
563 }
564 
565 static void MaterialPtrAssignOperator(const MaterialPtr& other, MaterialPtr* self)
566 {
567  (self)->operator=(other);
568 }
569 
570 static bool MaterialPtrIsNull(MaterialPtr* self)
571 {
572  return !(self)->operator bool();
573 }
574 
575 /***TECHNIQUE***/
577 
578 static PassArray* TechniqueGetPasses(Technique* self)
579 {
580  return new PassArray(self->getPasses());
581 }
582 
583 /***PASS***/
585 
587 {
588  return new TextureUnitStateArray(self->getTextureUnitStates());
589 }
590 
591 /***SUBENTITY***/
593 
595 {
596  return new SubEntityArray(self->getSubEntities());
597 }
598 
599 /***TIMER***/
600 static void TimerDefaultConstructor(Timer* self)
601 {
602  new(self) Timer();
603 }
604 
605 static void TimerDefaultDestructor(Timer* self)
606 {
607  self->~Timer();
608 }
609 
610 static void TimerCopyConstructor(const Timer& other, Timer* self)
611 {
612  new(self) Timer(other);
613 }
614 
615 static void TimerAssignOperator(const Timer& other, Timer* self)
616 {
617  (self)->operator=(other);
618 }
619 
620 /***GPUPROGRAMPARAMETERSPTR***/
621 static void GpuProgramParametersPtrDefaultConstructor(GpuProgramParametersPtr* self)
622 {
623  new (self) GpuProgramParametersPtr();
624 }
625 
626 static void GpuProgramParametersPtrCopyConstructor(const GpuProgramParametersPtr& other, GpuProgramParametersPtr* self)
627 {
628  new (self) GpuProgramParametersPtr(other);
629 }
630 
631 static void GpuProgramParametersPtrDestructor(GpuProgramParametersPtr* self)
632 {
633  (self)->~GpuProgramParametersPtr();
634 }
635 
636 static void GpuProgramParametersPtrAssignOperator(const GpuProgramParametersPtr& other, GpuProgramParametersPtr* self)
637 {
638  (self)->operator=(other);
639 }
640 
641 static bool GpuProgramParametersPtrIsNull(GpuProgramParametersPtr* self)
642 {
643  return !(self)->operator bool();
644 }
645 
646 // forward declarations, defined below
647 void registerOgreVector3(AngelScript::asIScriptEngine* engine);
648 void registerOgreVector2(AngelScript::asIScriptEngine* engine);
649 void registerOgreRadian(AngelScript::asIScriptEngine* engine);
650 void registerOgreDegree(AngelScript::asIScriptEngine* engine);
651 void registerOgreQuaternion(AngelScript::asIScriptEngine* engine);
652 void registerOgreOverlay(AngelScript::asIScriptEngine* engine);
653 void registerOgreColourValue(AngelScript::asIScriptEngine* engine);
654 void registerOgreBox(AngelScript::asIScriptEngine* engine);
655 
656 void registerOgreMovableObject(AngelScript::asIScriptEngine* engine);
657 void registerOgreEntity(AngelScript::asIScriptEngine* engine);
658 void registerOgreSubEntity(AngelScript::asIScriptEngine* engine);
659 void registerOgreNode(AngelScript::asIScriptEngine* engine);
660 void registerOgreSceneNode(AngelScript::asIScriptEngine* engine);
661 void registerOgreSceneManager(AngelScript::asIScriptEngine* engine);
662 void registerOgreRoot(AngelScript::asIScriptEngine* engine);
663 void registerOgreAnimationState(AngelScript::asIScriptEngine* engine);
664 void registerOgreAnimationStateSet(AngelScript::asIScriptEngine* engine);
665 void registerOgreTexture(AngelScript::asIScriptEngine* engine);
666 void registerOgreTextureManager(AngelScript::asIScriptEngine* engine);
667 void registerOgreManualObject(AngelScript::asIScriptEngine* engine);
668 void registerOgreHardwarePixelBuffer(AngelScript::asIScriptEngine* engine);
669 void registerOgrePixelBox(AngelScript::asIScriptEngine* engine);
670 void registerOgreImage(AngelScript::asIScriptEngine* engine);
671 void registerOgreMeshManager(AngelScript::asIScriptEngine* engine);
672 void registerOgreMesh(AngelScript::asIScriptEngine* engine);
673 void registerOgreSubMesh(AngelScript::asIScriptEngine* engine);
674 void registerOgreMaterialManager(AngelScript::asIScriptEngine* engine);
675 void registerOgreMaterial(AngelScript::asIScriptEngine* engine);
676 void registerOgreTechnique(AngelScript::asIScriptEngine* engine);
677 void registerOgrePass(AngelScript::asIScriptEngine* engine);
678 void registerOgreTextureUnitState(AngelScript::asIScriptEngine* engine);
679 void registerOgreTimer(AngelScript::asIScriptEngine* engine);
680 void registerOgreGpuProgramParameters(AngelScript::asIScriptEngine* engine);
681 
682 // main registration method
683 void RoR::RegisterOgreObjects(AngelScript::asIScriptEngine* engine)
684 {
685  int r;
686 
687  // We start by registering some data types, so angelscript knows that they exist
688 
689  // Ogre::Degree
690  r = engine->RegisterObjectType("degree", sizeof(Degree), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
691  ROR_ASSERT( r >= 0 );
692 
693  // Ogre::Radian
694  r = engine->RegisterObjectType("radian", sizeof(Radian), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
695  ROR_ASSERT( r >= 0 );
696 
697  // Ogre::Vector2
698  r = engine->RegisterObjectType("vector2", sizeof(Vector2), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
699  ROR_ASSERT( r >= 0 );
700 
701  // Ogre::Vector3
702  r = engine->RegisterObjectType("vector3", sizeof(Vector3), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
703  ROR_ASSERT( r >= 0 );
704 
705  // Ogre::Quaternion
706  r = engine->RegisterObjectType("quaternion", sizeof(Quaternion), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
707  ROR_ASSERT( r >= 0 );
708 
709  // Ogre::ColourValue
710  r = engine->RegisterObjectType("color", sizeof(ColourValue), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLFLOATS);
711  ROR_ASSERT( r >= 0 );
712 
713  // Ogre::Box
714  r = engine->RegisterObjectType("box", sizeof(Box), asOBJ_VALUE | asOBJ_POD | asOBJ_APP_CLASS_CA | asOBJ_APP_CLASS_ALLINTS);
715  ROR_ASSERT( r >= 0 );
716 
717  // More data types - the low-level scene API, under namespace `Ogre`
718 
719  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
720 
721  r = engine->RegisterObjectType("MovableObject", sizeof(MovableObject), asOBJ_REF | asOBJ_NOCOUNT);
722  ROR_ASSERT(r >= 0);
723 
724  r = engine->RegisterObjectType("Entity", sizeof(Entity), asOBJ_REF | asOBJ_NOCOUNT);
725  ROR_ASSERT(r >= 0);
726 
727  r = engine->RegisterObjectType("SubEntity", sizeof(Entity), asOBJ_REF | asOBJ_NOCOUNT);
728  ROR_ASSERT(r >= 0);
729 
730  r = engine->RegisterObjectType("Node", sizeof(Node), asOBJ_REF | asOBJ_NOCOUNT);
731  ROR_ASSERT(r >= 0);
732 
733  r = engine->RegisterObjectType("SceneNode", sizeof(SceneNode), asOBJ_REF | asOBJ_NOCOUNT);
734  ROR_ASSERT(r >= 0);
735 
736  r = engine->RegisterObjectType("SceneManager", sizeof(SceneManager), asOBJ_REF | asOBJ_NOCOUNT);
737  ROR_ASSERT(r >= 0);
738 
739  r = engine->RegisterObjectType("Root", sizeof(Root), asOBJ_REF | asOBJ_NOCOUNT);
740  ROR_ASSERT(r >= 0);
741 
742  r = engine->RegisterObjectType("AnimationState", sizeof(Root), asOBJ_REF | asOBJ_NOCOUNT);
743  ROR_ASSERT(r >= 0);
744 
745  r = engine->RegisterObjectType("AnimationStateSet", sizeof(Root), asOBJ_REF | asOBJ_NOCOUNT);
746  ROR_ASSERT(r >= 0);
747 
748  r = engine->RegisterObjectType("TexturePtr", sizeof(TexturePtr), asOBJ_VALUE | asGetTypeTraits<TexturePtr>());
749  ROR_ASSERT(r >= 0);
750 
751  r = engine->RegisterObjectType("TextureManager", sizeof(TextureManager), asOBJ_REF | asOBJ_NOCOUNT);
752  ROR_ASSERT(r >= 0);
753 
754  r = engine->RegisterObjectType("ManualObject", sizeof(TextureManager), asOBJ_REF | asOBJ_NOCOUNT);
755  ROR_ASSERT(r >= 0);
756 
757  r = engine->RegisterObjectType("Image", sizeof(Image), asOBJ_VALUE | asGetTypeTraits<Image>());
758  ROR_ASSERT(r >= 0);
759 
760  // NOTE: The `*SharedPtr` is a deprecated alias of `*Ptr` in OGRE 14, but in the version we're using it doesn't exist yet.
761  r = engine->RegisterObjectType("HardwarePixelBufferPtr", sizeof(HardwarePixelBufferSharedPtr), asOBJ_VALUE | asGetTypeTraits<HardwarePixelBufferSharedPtr>());
762  ROR_ASSERT(r >= 0);
763 
764  r = engine->RegisterObjectType("PixelBox", sizeof(PixelBox), asOBJ_VALUE | asGetTypeTraits<PixelBox>());
765  ROR_ASSERT(r >= 0);
766 
767  r = engine->RegisterObjectType("MeshPtr", sizeof(MeshPtr), asOBJ_VALUE | asGetTypeTraits<TexturePtr>());
768  ROR_ASSERT(r >= 0);
769 
770  r = engine->RegisterObjectType("SubMesh", sizeof(SubMesh), asOBJ_REF | asOBJ_NOCOUNT);
771  ROR_ASSERT(r >= 0);
772 
773  r = engine->RegisterObjectType("MeshManager", sizeof(TextureManager), asOBJ_REF | asOBJ_NOCOUNT);
774  ROR_ASSERT(r >= 0);
775 
776  r = engine->RegisterObjectType("MaterialManager", sizeof(MaterialManager), asOBJ_REF | asOBJ_NOCOUNT);
777  ROR_ASSERT(r >= 0);
778 
779  r = engine->RegisterObjectType("MaterialPtr", sizeof(MeshPtr), asOBJ_VALUE | asGetTypeTraits<TexturePtr>());
780  ROR_ASSERT(r >= 0);
781 
782  r = engine->RegisterObjectType("Technique", sizeof(SubMesh), asOBJ_REF | asOBJ_NOCOUNT);
783  ROR_ASSERT(r >= 0);
784 
785  r = engine->RegisterObjectType("Pass", sizeof(SubMesh), asOBJ_REF | asOBJ_NOCOUNT);
786  ROR_ASSERT(r >= 0);
787 
788  r = engine->RegisterObjectType("TextureUnitState", sizeof(SubMesh), asOBJ_REF | asOBJ_NOCOUNT);
789  ROR_ASSERT(r >= 0);
790 
791  r = engine->RegisterObjectType("Timer", sizeof(Timer), asOBJ_VALUE | asGetTypeTraits<Timer>());
792  ROR_ASSERT(r >= 0);
793 
794  r = engine->RegisterObjectType("GpuProgramParametersPtr", sizeof(GpuProgramParametersPtr), asOBJ_VALUE | asGetTypeTraits<GpuProgramParametersPtr>());
795  ROR_ASSERT(r >= 0);
796 
797  // dictionary/array view types, also under namespace `Ogre`
798 
799  SceneManagerInstanceDict::RegisterReadonlyScriptDictView(engine, "SceneManagerInstanceDict", "SceneManager");
800  MovableObjectArray::RegisterReadonlyScriptArrayView(engine, "MovableObjectArray", "MovableObject");
801  ChildNodeArray::RegisterReadonlyScriptArrayView(engine, "ChildNodeArray", "Node");
802  AnimationStateDict::RegisterReadonlyScriptDictView(engine, "AnimationStateDict", "AnimationState");
803  SubMeshArray::RegisterReadonlyScriptArrayView(engine, "SubMeshArray", "SubMesh");
804  TechniqueArray::RegisterReadonlyScriptArrayView(engine, "TechniqueArray", "Technique");
805  PassArray::RegisterReadonlyScriptArrayView(engine, "PassArray", "Pass");
806  TextureUnitStateArray::RegisterReadonlyScriptArrayView(engine, "TextureUnitStateArray", "TextureUnitState");
807  SubEntityArray::RegisterReadonlyScriptArrayView(engine, "SubEntityArray", "SubEntity");
808 
809  // enums, also under namespace `Ogre`
810 
811  r = engine->RegisterEnum("IndexType"); ROR_ASSERT(r >= 0);
812  r = engine->RegisterEnumValue("IndexType", "IT_16BIT", Ogre::HardwareIndexBuffer::IT_16BIT); ROR_ASSERT(r >= 0);
813  r = engine->RegisterEnumValue("IndexType", "IT_32BIT", Ogre::HardwareIndexBuffer::IT_32BIT); ROR_ASSERT(r >= 0);
814 
815  r = engine->RegisterEnum("TransformSpace"); ROR_ASSERT(r >= 0);
816  r = engine->RegisterEnumValue("TransformSpace", "TS_LOCAL", Node::TS_LOCAL); ROR_ASSERT(r >= 0); // Transform is relative to the local space
817  r = engine->RegisterEnumValue("TransformSpace", "TS_PARENT", Node::TS_PARENT); ROR_ASSERT(r >= 0); // Transform is relative to the space of the parent node
818  r = engine->RegisterEnumValue("TransformSpace", "TS_WORLD", Node::TS_WORLD); ROR_ASSERT(r >= 0); // Transform is relative to world space
819 
820  r = engine->RegisterEnum("RenderOperation"); ROR_ASSERT(r >= 0); // NOTE: `Ogre::RenderOperation` is a wrapper class - the enum is `OperationType`
821  r = engine->RegisterEnumValue("RenderOperation", "OT_POINT_LIST", Ogre::RenderOperation::OT_POINT_LIST); ROR_ASSERT(r >= 0); // A list of points, 1 vertex per point
822  r = engine->RegisterEnumValue("RenderOperation", "OT_LINE_LIST", Ogre::RenderOperation::OT_LINE_LIST); ROR_ASSERT(r >= 0); // A list of lines, 2 vertices per line
823  r = engine->RegisterEnumValue("RenderOperation", "OT_LINE_STRIP", Ogre::RenderOperation::OT_LINE_STRIP); ROR_ASSERT(r >= 0); // A strip of connected lines, 1 vertex per line plus 1 start vertex
824  r = engine->RegisterEnumValue("RenderOperation", "OT_TRIANGLE_LIST", Ogre::RenderOperation::OT_TRIANGLE_LIST); ROR_ASSERT(r >= 0); // A list of triangles, 3 vertices per triangle
825  r = engine->RegisterEnumValue("RenderOperation", "OT_TRIANGLE_STRIP", Ogre::RenderOperation::OT_TRIANGLE_STRIP); ROR_ASSERT(r >= 0);// A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that
826  r = engine->RegisterEnumValue("RenderOperation", "OT_TRIANGLE_FAN", Ogre::RenderOperation::OT_TRIANGLE_FAN); ROR_ASSERT(r >= 0); // A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that
827 
828  r = engine->RegisterEnum("ImageFilter"); ROR_ASSERT(r >= 0); // Only registering those which are in OGRE14 docs, even though our older version has more
829  r = engine->RegisterEnumValue("ImageFilter", "FILTER_NEAREST", Image::Filter::FILTER_NEAREST); ROR_ASSERT(r >= 0);
830  r = engine->RegisterEnumValue("ImageFilter", "FILTER_LINEAR", Image::Filter::FILTER_LINEAR); ROR_ASSERT(r >= 0);
831  r = engine->RegisterEnumValue("ImageFilter", "FILTER_BILINEAR", Image::Filter::FILTER_BILINEAR); ROR_ASSERT(r >= 0);
832 
833  r = engine->RegisterEnum("HardwareBufferLockOptions"); ROR_ASSERT(r >= 0);
834  r = engine->RegisterEnumValue("HardwareBufferLockOptions", "HBL_NORMAL", HardwareBuffer::LockOptions::HBL_NORMAL); ROR_ASSERT(r >= 0);
835  r = engine->RegisterEnumValue("HardwareBufferLockOptions", "HBL_DISCARD", HardwareBuffer::LockOptions::HBL_DISCARD); ROR_ASSERT(r >= 0);
836  r = engine->RegisterEnumValue("HardwareBufferLockOptions", "HBL_READ_ONLY", HardwareBuffer::LockOptions::HBL_READ_ONLY); ROR_ASSERT(r >= 0);
837  r = engine->RegisterEnumValue("HardwareBufferLockOptions", "HBL_NO_OVERWRITE", HardwareBuffer::LockOptions::HBL_NO_OVERWRITE); ROR_ASSERT(r >= 0);
838  r = engine->RegisterEnumValue("HardwareBufferLockOptions", "HBL_WRITE_ONLY", HardwareBuffer::LockOptions::HBL_WRITE_ONLY); ROR_ASSERT(r >= 0);
839 
840  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
841 
842  // Now we register the object properties and methods
843 
844  registerOgreRadian(engine);
845  registerOgreDegree(engine);
846  registerOgreVector3(engine);
847  registerOgreVector2(engine);
848  registerOgreQuaternion(engine);
849  registerOgreColourValue(engine);
850  registerOgreBox(engine);
851 
852  registerOgreNode(engine);
854  registerOgreEntity(engine);
855  registerOgreSubEntity(engine);
856  registerOgreSceneNode(engine);
857  registerOgreSceneManager(engine);
858  registerOgreRoot(engine);
861  registerOgreTexture(engine);
863  registerOgreOverlay(engine);
864  registerOgreManualObject(engine);
866  registerOgrePixelBox(engine);
867  registerOgreImage(engine);
868  registerOgreMesh(engine);
869  registerOgreSubMesh(engine);
870  registerOgreMeshManager(engine);
871  registerOgreMaterial(engine);
872  registerOgreTechnique(engine);
873  registerOgrePass(engine);
876  registerOgreTimer(engine);
878 
879  // To estabilish class hierarchy in AngelScript you need to register the reference cast operators opCast and opImplCast.
880 
881  // - `SceneNode` derives from `Node`
882  r = engine->RegisterObjectMethod("Ogre::Node", "Ogre::SceneNode@ opCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::Node, Ogre::SceneNode>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
883  r = engine->RegisterObjectMethod("Ogre::SceneNode", "Ogre::Node@ opImplCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::SceneNode, Ogre::Node>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
884  // - `Entity` derives from `MovableObject`
885  r = engine->RegisterObjectMethod("Ogre::MovableObject", "Ogre::Entity@ opCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::MovableObject, Ogre::Entity>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
886  r = engine->RegisterObjectMethod("Ogre::Entity", "Ogre::MovableObject@ opImplCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::Entity, Ogre::MovableObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
887  // - `ManualObject` derives from `MovableObject`
888  r = engine->RegisterObjectMethod("Ogre::MovableObject", "Ogre::ManualObject@ opCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::MovableObject, Ogre::ManualObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
889  r = engine->RegisterObjectMethod("Ogre::ManualObject", "Ogre::MovableObject@ opImplCast()", asFUNCTION((ScriptRefCastNoCount<Ogre::ManualObject, Ogre::MovableObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
890 
891 
892  // Also register the const overloads so the cast works also when the handle is read only
893 
894  // - `SceneNode` derives from `Node`
895  r = engine->RegisterObjectMethod("Ogre::Node", "const Ogre::SceneNode@ opCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::Node, Ogre::SceneNode>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
896  r = engine->RegisterObjectMethod("Ogre::SceneNode", "const Ogre::Node@ opImplCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::SceneNode, Ogre::Node>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
897  // - `Entity` derives from `MovableObject`
898  r = engine->RegisterObjectMethod("Ogre::MovableObject", "const Ogre::Entity@ opCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::MovableObject, Ogre::Entity>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
899  r = engine->RegisterObjectMethod("Ogre::Entity", "const Ogre::MovableObject@ opImplCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::Entity, Ogre::MovableObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
900  // - `ManualObject` derives from `MovableObject`
901  r = engine->RegisterObjectMethod("Ogre::MovableObject", "const Ogre::ManualObject@ opCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::MovableObject, Ogre::ManualObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
902  r = engine->RegisterObjectMethod("Ogre::ManualObject", "const Ogre::MovableObject@ opImplCast() const", asFUNCTION((ScriptRefCastNoCount<Ogre::ManualObject, Ogre::MovableObject>)), asCALL_CDECL_OBJLAST); assert(r >= 0);
903 
904 }
905 
906 // register Ogre::Vector3
907 void registerOgreVector3(AngelScript::asIScriptEngine* engine)
908 {
909  int r;
910 
911  // Register the object properties
912  r = engine->RegisterObjectProperty("vector3", "float x", offsetof(Ogre::Vector3, x));
913  ROR_ASSERT( r >= 0 );
914  r = engine->RegisterObjectProperty("vector3", "float y", offsetof(Ogre::Vector3, y));
915  ROR_ASSERT( r >= 0 );
916  r = engine->RegisterObjectProperty("vector3", "float z", offsetof(Ogre::Vector3, z));
917  ROR_ASSERT( r >= 0 );
918 
919  // Register the object constructors
920  r = engine->RegisterObjectBehaviour("vector3", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(Vector3DefaultConstructor), asCALL_CDECL_OBJLAST);
921  ROR_ASSERT( r >= 0 );
922  r = engine->RegisterObjectBehaviour("vector3", asBEHAVE_CONSTRUCT, "void f(float, float, float)", asFUNCTION(Vector3InitConstructor), asCALL_CDECL_OBJLAST);
923  ROR_ASSERT( r >= 0 );
924  r = engine->RegisterObjectBehaviour("vector3", asBEHAVE_CONSTRUCT, "void f(const vector3 &in)", asFUNCTION(Vector3CopyConstructor), asCALL_CDECL_OBJLAST);
925  ROR_ASSERT( r >= 0 );
926  r = engine->RegisterObjectBehaviour("vector3", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(Vector3InitConstructorScaler), asCALL_CDECL_OBJLAST);
927  ROR_ASSERT( r >= 0 );
928 
929  // Register the object operators
930  r = engine->RegisterObjectMethod("vector3", "float opIndex(int) const", asMETHODPR(Vector3, operator[], (size_t) const, float), asCALL_THISCALL);
931  ROR_ASSERT( r >= 0 );
932  r = engine->RegisterObjectMethod("vector3", "vector3 &f(const vector3 &in)", asMETHODPR(Vector3, operator =, (const Vector3 &), Vector3&), asCALL_THISCALL);
933  ROR_ASSERT( r >= 0 );
934  r = engine->RegisterObjectMethod("vector3", "bool opEquals(const vector3 &in) const", asMETHODPR(Vector3, operator==,(const Vector3&) const, bool), asCALL_THISCALL);
935  ROR_ASSERT( r >= 0 );
936 
937  r = engine->RegisterObjectMethod("vector3", "vector3 opAdd(const vector3 &in) const", asMETHODPR(Vector3, operator+,(const Vector3&) const, Vector3), asCALL_THISCALL);
938  ROR_ASSERT( r >= 0 );
939  r = engine->RegisterObjectMethod("vector3", "vector3 opSub(const vector3 &in) const", asMETHODPR(Vector3, operator-,(const Vector3&) const, Vector3), asCALL_THISCALL);
940  ROR_ASSERT( r >= 0 );
941 
942  r = engine->RegisterObjectMethod("vector3", "vector3 opMul(float) const", asMETHODPR(Vector3, operator*,(const float) const, Vector3), asCALL_THISCALL);
943  ROR_ASSERT( r >= 0 );
944  r = engine->RegisterObjectMethod("vector3", "vector3 opMul(const vector3 &in) const", asMETHODPR(Vector3, operator*,(const Vector3&) const, Vector3), asCALL_THISCALL);
945  ROR_ASSERT( r >= 0 );
946  r = engine->RegisterObjectMethod("vector3", "vector3 opDiv(float) const", asMETHODPR(Vector3, operator/,(const float) const, Vector3), asCALL_THISCALL);
947  ROR_ASSERT( r >= 0 );
948  r = engine->RegisterObjectMethod("vector3", "vector3 opDiv(const vector3 &in) const", asMETHODPR(Vector3, operator/,(const Vector3&) const, Vector3), asCALL_THISCALL);
949  ROR_ASSERT( r >= 0 );
950 
951  r = engine->RegisterObjectMethod("vector3", "vector3 opAdd() const", asMETHODPR(Vector3, operator+,() const, const Vector3&), asCALL_THISCALL);
952  ROR_ASSERT( r >= 0 );
953  r = engine->RegisterObjectMethod("vector3", "vector3 opSub() const", asMETHODPR(Vector3, operator-,() const, Vector3), asCALL_THISCALL);
954  ROR_ASSERT( r >= 0 );
955 
956  //r = engine->RegisterObjectMethod("vector3", "vector3 opMul(float, const vector3 &in)", asMETHODPR(Vector3, operator*,(const float, const Vector3&), Vector3), asCALL_THISCALL); ROR_ASSERT( r >= 0 );
957 
958  r = engine->RegisterObjectMethod("vector3", "vector3 &opAddAssign(const vector3 &in)", asMETHODPR(Vector3,operator+=,(const Vector3 &),Vector3&), asCALL_THISCALL);
959  ROR_ASSERT( r >= 0 );
960  r = engine->RegisterObjectMethod("vector3", "vector3 &opAddAssign(float)", asMETHODPR(Vector3,operator+=,(const float),Vector3&), asCALL_THISCALL);
961  ROR_ASSERT( r >= 0 );
962 
963  r = engine->RegisterObjectMethod("vector3", "vector3 &opSubAssign(const vector3 &in)", asMETHODPR(Vector3,operator-=,(const Vector3 &),Vector3&), asCALL_THISCALL);
964  ROR_ASSERT( r >= 0 );
965  r = engine->RegisterObjectMethod("vector3", "vector3 &opSubAssign(float)", asMETHODPR(Vector3,operator-=,(const float),Vector3&), asCALL_THISCALL);
966  ROR_ASSERT( r >= 0 );
967 
968  r = engine->RegisterObjectMethod("vector3", "vector3 &opMulAssign(const vector3 &in)", asMETHODPR(Vector3,operator*=,(const Vector3 &),Vector3&), asCALL_THISCALL);
969  ROR_ASSERT( r >= 0 );
970  r = engine->RegisterObjectMethod("vector3", "vector3 &opMulAssign(float)", asMETHODPR(Vector3,operator*=,(const float),Vector3&), asCALL_THISCALL);
971  ROR_ASSERT( r >= 0 );
972 
973  //r = engine->RegisterObjectMethod("vector3", "vector3& operator @= ( const vector3& rkVector f( const Vector3& rkVector )", asMETHOD(Ogre::Vector3, f), asCALL_THISCALL); ROR_ASSERT(r>=0);
974 
975  r = engine->RegisterObjectMethod("vector3", "vector3 &opDivAssign(const vector3 &in)", asMETHODPR(Vector3,operator/=,(const Vector3 &),Vector3&), asCALL_THISCALL);
976  ROR_ASSERT( r >= 0 );
977  r = engine->RegisterObjectMethod("vector3", "vector3 &opDivAssign(float)", asMETHODPR(Vector3,operator/=,(const float),Vector3&), asCALL_THISCALL);
978  ROR_ASSERT( r >= 0 );
979 
980  // r = engine->RegisterObjectMethod("vector3", "int opCmp(const vector3 &in) const", asFUNCTION(Vector3Cmp), asCALL_CDECL_OBJFIRST); ROR_ASSERT( r >= 0 );
981 
982  // Register the object methods
983  // r = engine->RegisterObjectMethod("vector3", "void swap(vector3 &inout)", asMETHOD(Vector3,swap), asCALL_THISCALL); ROR_ASSERT( r >= 0 );
984 
985  r = engine->RegisterObjectMethod("vector3", "float length() const", asMETHOD(Vector3,length), asCALL_THISCALL);
986  ROR_ASSERT( r >= 0 );
987  r = engine->RegisterObjectMethod("vector3", "float squaredLength() const", asMETHOD(Vector3,squaredLength), asCALL_THISCALL);
988  ROR_ASSERT( r >= 0 );
989 
990  r = engine->RegisterObjectMethod("vector3", "float distance(const vector3 &in) const", asMETHOD(Vector3,distance), asCALL_THISCALL);
991  ROR_ASSERT( r >= 0 );
992  r = engine->RegisterObjectMethod("vector3", "float squaredDistance(const vector3 &in) const", asMETHOD(Vector3,squaredDistance), asCALL_THISCALL);
993  ROR_ASSERT( r >= 0 );
994 
995  r = engine->RegisterObjectMethod("vector3", "float dotProduct(const vector3 &in) const", asMETHOD(Vector3,dotProduct), asCALL_THISCALL);
996  ROR_ASSERT( r >= 0 );
997  r = engine->RegisterObjectMethod("vector3", "float absDotProduct(const vector3 &in) const", asMETHOD(Vector3,absDotProduct), asCALL_THISCALL);
998  ROR_ASSERT( r >= 0 );
999 
1000  r = engine->RegisterObjectMethod("vector3", "float normalise()", asMETHOD(Vector3,normalise), asCALL_THISCALL);
1001  ROR_ASSERT( r >= 0 );
1002  r = engine->RegisterObjectMethod("vector3", "float crossProduct(const vector3 &in) const", asMETHOD(Vector3,crossProduct), asCALL_THISCALL);
1003  ROR_ASSERT( r >= 0 );
1004  r = engine->RegisterObjectMethod("vector3", "vector3 midPoint(const vector3 &in) const", asMETHOD(Vector3,midPoint), asCALL_THISCALL);
1005  ROR_ASSERT( r >= 0 );
1006  r = engine->RegisterObjectMethod("vector3", "void makeFloor(const vector3 &in)", asMETHOD(Vector3,makeFloor), asCALL_THISCALL);
1007  ROR_ASSERT( r >= 0 );
1008  r = engine->RegisterObjectMethod("vector3", "void makeCeil(const vector3 &in)", asMETHOD(Vector3,makeCeil), asCALL_THISCALL);
1009  ROR_ASSERT( r >= 0 );
1010  r = engine->RegisterObjectMethod("vector3", "vector3 perpendicular() const", asMETHOD(Vector3,perpendicular), asCALL_THISCALL);
1011  ROR_ASSERT( r >= 0 );
1012  r = engine->RegisterObjectMethod("vector3", "vector3 randomDeviant(const radian &in, const vector3 &in) const", asMETHOD(Vector3,randomDeviant), asCALL_THISCALL);
1013  ROR_ASSERT( r >= 0 );
1014  r = engine->RegisterObjectMethod("vector3", "radian angleBetween(const vector3 &in)", asMETHOD(Vector3,angleBetween), asCALL_THISCALL);
1015  ROR_ASSERT( r >= 0 );
1016  r = engine->RegisterObjectMethod("vector3", "quaternion getRotationTo(const vector3 &in, const vector3 &in) const", asMETHOD(Vector3,getRotationTo), asCALL_THISCALL);
1017  ROR_ASSERT( r >= 0 );
1018  r = engine->RegisterObjectMethod("vector3", "bool isZeroLength() const", asMETHOD(Vector3,isZeroLength), asCALL_THISCALL);
1019  ROR_ASSERT( r >= 0 );
1020  r = engine->RegisterObjectMethod("vector3", "vector3 normalisedCopy() const", asMETHOD(Vector3,normalisedCopy), asCALL_THISCALL);
1021  ROR_ASSERT( r >= 0 );
1022  r = engine->RegisterObjectMethod("vector3", "vector3 reflect(const vector3 &in) const", asMETHOD(Vector3,reflect), asCALL_THISCALL);
1023  ROR_ASSERT( r >= 0 );
1024 
1025  r = engine->RegisterObjectMethod("vector3", "bool positionEquals(const vector3 &in, float) const", asMETHOD(Vector3,positionEquals), asCALL_THISCALL);
1026  ROR_ASSERT( r >= 0 );
1027  r = engine->RegisterObjectMethod("vector3", "bool positionCloses(const vector3 &in, float) const", asMETHOD(Vector3,positionCloses), asCALL_THISCALL);
1028  ROR_ASSERT( r >= 0 );
1029  r = engine->RegisterObjectMethod("vector3", "bool directionEquals(const vector3 &in, radian &in) const", asMETHOD(Vector3,directionEquals), asCALL_THISCALL);
1030  ROR_ASSERT( r >= 0 );
1031 
1032  r = engine->RegisterObjectMethod("vector3", "bool isNaN() const", asMETHOD(Vector3,isNaN), asCALL_THISCALL);
1033  ROR_ASSERT( r >= 0 );
1034 }
1035 
1036 
1037 // register Ogre::Vector2
1038 void registerOgreVector2(AngelScript::asIScriptEngine* engine)
1039 {
1040  int r;
1041 
1042  // Register the object properties
1043  r = engine->RegisterObjectProperty("vector2", "float x", offsetof(Ogre::Vector2, x));
1044  ROR_ASSERT( r >= 0 );
1045  r = engine->RegisterObjectProperty("vector2", "float y", offsetof(Ogre::Vector2, y));
1046  ROR_ASSERT( r >= 0 );
1047 
1048  // Register the object constructors
1049  r = engine->RegisterObjectBehaviour("vector2", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(Vector2DefaultConstructor), asCALL_CDECL_OBJLAST);
1050  ROR_ASSERT( r >= 0 );
1051  r = engine->RegisterObjectBehaviour("vector2", asBEHAVE_CONSTRUCT, "void f(float, float)", asFUNCTION(Vector2InitConstructor), asCALL_CDECL_OBJLAST);
1052  ROR_ASSERT( r >= 0 );
1053  r = engine->RegisterObjectBehaviour("vector2", asBEHAVE_CONSTRUCT, "void f(const vector2 &in)", asFUNCTION(Vector2CopyConstructor), asCALL_CDECL_OBJLAST);
1054  ROR_ASSERT( r >= 0 );
1055  r = engine->RegisterObjectBehaviour("vector2", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(Vector2InitConstructorScaler), asCALL_CDECL_OBJLAST);
1056  ROR_ASSERT( r >= 0 );
1057 
1058  // Register the object operators
1059  r = engine->RegisterObjectMethod("vector2", "float opIndex(int) const", asMETHODPR(Vector2, operator[], (size_t) const, float), asCALL_THISCALL);
1060  ROR_ASSERT( r >= 0 );
1061  r = engine->RegisterObjectMethod("vector2", "vector2 &f(const vector2 &in)", asMETHODPR(Vector2, operator =, (const Vector2 &), Vector2&), asCALL_THISCALL);
1062  ROR_ASSERT( r >= 0 );
1063  r = engine->RegisterObjectMethod("vector2", "bool opEquals(const vector2 &in) const", asMETHODPR(Vector2, operator==,(const Vector2&) const, bool), asCALL_THISCALL);
1064  ROR_ASSERT( r >= 0 );
1065 
1066  r = engine->RegisterObjectMethod("vector2", "vector2 opAdd(const vector2 &in) const", asMETHODPR(Vector2, operator+,(const Vector2&) const, Vector2), asCALL_THISCALL);
1067  ROR_ASSERT( r >= 0 );
1068  r = engine->RegisterObjectMethod("vector2", "vector2 opSub(const vector2 &in) const", asMETHODPR(Vector2, operator-,(const Vector2&) const, Vector2), asCALL_THISCALL);
1069  ROR_ASSERT( r >= 0 );
1070 
1071  r = engine->RegisterObjectMethod("vector2", "vector2 opMul(float) const", asMETHODPR(Vector2, operator*,(const float) const, Vector2), asCALL_THISCALL);
1072  ROR_ASSERT( r >= 0 );
1073  r = engine->RegisterObjectMethod("vector2", "vector2 opMul(const vector2 &in) const", asMETHODPR(Vector2, operator*,(const Vector2&) const, Vector2), asCALL_THISCALL);
1074  ROR_ASSERT( r >= 0 );
1075  r = engine->RegisterObjectMethod("vector2", "vector2 opDiv(float) const", asMETHODPR(Vector2, operator/,(const float) const, Vector2), asCALL_THISCALL);
1076  ROR_ASSERT( r >= 0 );
1077  r = engine->RegisterObjectMethod("vector2", "vector2 opDiv(const vector2 &in) const", asMETHODPR(Vector2, operator/,(const Vector2&) const, Vector2), asCALL_THISCALL);
1078  ROR_ASSERT( r >= 0 );
1079 
1080  r = engine->RegisterObjectMethod("vector2", "vector2 opAdd() const", asMETHODPR(Vector2, operator+,() const, const Vector2&), asCALL_THISCALL);
1081  ROR_ASSERT( r >= 0 );
1082  r = engine->RegisterObjectMethod("vector2", "vector2 opSub() const", asMETHODPR(Vector2, operator-,() const, Vector2), asCALL_THISCALL);
1083  ROR_ASSERT( r >= 0 );
1084 
1085  r = engine->RegisterObjectMethod("vector2", "vector2 &opAddAssign(const vector2 &in)", asMETHODPR(Vector2,operator+=,(const Vector2 &),Vector2&), asCALL_THISCALL);
1086  ROR_ASSERT( r >= 0 );
1087  r = engine->RegisterObjectMethod("vector2", "vector2 &opAddAssign(float)", asMETHODPR(Vector2,operator+=,(const float),Vector2&), asCALL_THISCALL);
1088  ROR_ASSERT( r >= 0 );
1089 
1090  r = engine->RegisterObjectMethod("vector2", "vector2 &opSubAssign(const vector2 &in)", asMETHODPR(Vector2,operator-=,(const Vector2 &),Vector2&), asCALL_THISCALL);
1091  ROR_ASSERT( r >= 0 );
1092  r = engine->RegisterObjectMethod("vector2", "vector2 &opSubAssign(float)", asMETHODPR(Vector2,operator-=,(const float),Vector2&), asCALL_THISCALL);
1093  ROR_ASSERT( r >= 0 );
1094 
1095  r = engine->RegisterObjectMethod("vector2", "vector2 &opMulAssign(const vector2 &in)", asMETHODPR(Vector2,operator*=,(const Vector2 &),Vector2&), asCALL_THISCALL);
1096  ROR_ASSERT( r >= 0 );
1097  r = engine->RegisterObjectMethod("vector2", "vector2 &opMulAssign(float)", asMETHODPR(Vector2,operator*=,(const float),Vector2&), asCALL_THISCALL);
1098  ROR_ASSERT( r >= 0 );
1099 
1100  r = engine->RegisterObjectMethod("vector2", "vector2 &opDivAssign(const vector2 &in)", asMETHODPR(Vector2,operator/=,(const Vector2 &),Vector2&), asCALL_THISCALL);
1101  ROR_ASSERT( r >= 0 );
1102  r = engine->RegisterObjectMethod("vector2", "vector2 &opDivAssign(float)", asMETHODPR(Vector2,operator/=,(const float),Vector2&), asCALL_THISCALL);
1103  ROR_ASSERT( r >= 0 );
1104 
1105  // Register the object methods
1106 
1107  r = engine->RegisterObjectMethod("vector2", "float length() const", asMETHOD(Vector2,length), asCALL_THISCALL);
1108  ROR_ASSERT( r >= 0 );
1109  r = engine->RegisterObjectMethod("vector2", "float squaredLength() const", asMETHOD(Vector2,squaredLength), asCALL_THISCALL);
1110  ROR_ASSERT( r >= 0 );
1111 
1112  r = engine->RegisterObjectMethod("vector2", "float distance(const vector2 &in) const", asMETHOD(Vector2,distance), asCALL_THISCALL);
1113  ROR_ASSERT( r >= 0 );
1114  r = engine->RegisterObjectMethod("vector2", "float squaredDistance(const vector2 &in) const", asMETHOD(Vector2,squaredDistance), asCALL_THISCALL);
1115  ROR_ASSERT( r >= 0 );
1116 
1117  r = engine->RegisterObjectMethod("vector2", "float dotProduct(const vector2 &in) const", asMETHOD(Vector2,dotProduct), asCALL_THISCALL);
1118  ROR_ASSERT( r >= 0 );
1119 
1120  r = engine->RegisterObjectMethod("vector2", "float normalise()", asMETHOD(Vector2,normalise), asCALL_THISCALL);
1121  ROR_ASSERT( r >= 0 );
1122  r = engine->RegisterObjectMethod("vector2", "float crossProduct(const vector2 &in) const", asMETHOD(Vector2,crossProduct), asCALL_THISCALL);
1123  ROR_ASSERT( r >= 0 );
1124  r = engine->RegisterObjectMethod("vector2", "vector2 midPoint(const vector2 &in) const", asMETHOD(Vector2,midPoint), asCALL_THISCALL);
1125  ROR_ASSERT( r >= 0 );
1126  r = engine->RegisterObjectMethod("vector2", "void makeFloor(const vector2 &in)", asMETHOD(Vector2,makeFloor), asCALL_THISCALL);
1127  ROR_ASSERT( r >= 0 );
1128  r = engine->RegisterObjectMethod("vector2", "void makeCeil(const vector2 &in)", asMETHOD(Vector2,makeCeil), asCALL_THISCALL);
1129  ROR_ASSERT( r >= 0 );
1130  r = engine->RegisterObjectMethod("vector2", "vector2 perpendicular() const", asMETHOD(Vector2,perpendicular), asCALL_THISCALL);
1131  ROR_ASSERT( r >= 0 );
1132  r = engine->RegisterObjectMethod("vector2", "vector2 randomDeviant(const radian &in, const vector2 &in) const", asMETHOD(Vector2,randomDeviant), asCALL_THISCALL);
1133  ROR_ASSERT( r >= 0 );
1134  r = engine->RegisterObjectMethod("vector2", "radian angleBetween(const vector2 &in)", asMETHOD(Vector2,angleBetween), asCALL_THISCALL);
1135  ROR_ASSERT( r >= 0 );
1136  r = engine->RegisterObjectMethod("vector2", "bool isZeroLength() const", asMETHOD(Vector2,isZeroLength), asCALL_THISCALL);
1137  ROR_ASSERT( r >= 0 );
1138  r = engine->RegisterObjectMethod("vector2", "vector2 normalisedCopy() const", asMETHOD(Vector2,normalisedCopy), asCALL_THISCALL);
1139  ROR_ASSERT( r >= 0 );
1140  r = engine->RegisterObjectMethod("vector2", "vector2 reflect(const vector2 &in) const", asMETHOD(Vector2,reflect), asCALL_THISCALL);
1141  ROR_ASSERT( r >= 0 );
1142 
1143  r = engine->RegisterObjectMethod("vector2", "bool positionEquals(const vector2 &in, float) const", asMETHOD(Vector2,positionEquals), asCALL_THISCALL);
1144  ROR_ASSERT( r >= 0 );
1145 
1146  r = engine->RegisterObjectMethod("vector2", "bool isNaN() const", asMETHOD(Vector2,isNaN), asCALL_THISCALL);
1147  ROR_ASSERT( r >= 0 );
1148 }
1149 
1150 void registerOgreRadian(AngelScript::asIScriptEngine* engine)
1151 {
1152  int r;
1153 
1154  // Register the object constructors
1155  r = engine->RegisterObjectBehaviour("radian", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(RadianDefaultConstructor), asCALL_CDECL_OBJLAST);
1156  ROR_ASSERT( r >= 0 );
1157  r = engine->RegisterObjectBehaviour("radian", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(RadianInitConstructor), asCALL_CDECL_OBJLAST);
1158  ROR_ASSERT( r >= 0 );
1159  r = engine->RegisterObjectBehaviour("radian", asBEHAVE_CONSTRUCT, "void f(const radian &in)", asFUNCTION(RadianCopyConstructor), asCALL_CDECL_OBJLAST);
1160  ROR_ASSERT( r >= 0 );
1161 
1162  // Disabled during port to latest AngelScript because `asBEHAVE_IMPLICIT_VALUE_CAST` is deprecated.
1163  // TODO: Research and restore it ~ only_a_ptr, 08/2017
1164  // // Register other object behaviours
1165  // r = engine->RegisterObjectBehaviour("radian", asBEHAVE_IMPLICIT_VALUE_CAST, "float f() const", asMETHOD(Radian,valueRadians), asCALL_THISCALL);
1166  // ROR_ASSERT( r >= 0 );
1167  // r = engine->RegisterObjectBehaviour("radian", asBEHAVE_IMPLICIT_VALUE_CAST, "double f() const", asMETHOD(Radian,valueRadians), asCALL_THISCALL);
1168  // ROR_ASSERT( r >= 0 );
1169 
1170  // Register the object operators
1171  r = engine->RegisterObjectMethod("radian", "radian &opAssign(const radian &in)", asMETHODPR(Radian, operator =, (const Radian &), Radian&), asCALL_THISCALL);
1172  ROR_ASSERT( r >= 0 );
1173  r = engine->RegisterObjectMethod("radian", "radian &opAssign(const float)", asMETHODPR(Radian, operator =, (const float &), Radian&), asCALL_THISCALL);
1174  ROR_ASSERT( r >= 0 );
1175  r = engine->RegisterObjectMethod("radian", "radian &opAssign(const degree &in)", asMETHODPR(Radian, operator =, (const Degree &), Radian&), asCALL_THISCALL);
1176  ROR_ASSERT( r >= 0 );
1177 
1178  r = engine->RegisterObjectMethod("radian", "radian opAdd() const", asMETHODPR(Radian, operator+,() const, const Radian&), asCALL_THISCALL);
1179  ROR_ASSERT( r >= 0 );
1180  r = engine->RegisterObjectMethod("radian", "radian opAdd(const radian &in) const", asMETHODPR(Radian, operator+,(const Radian&) const, Radian), asCALL_THISCALL);
1181  ROR_ASSERT( r >= 0 );
1182  r = engine->RegisterObjectMethod("radian", "radian opAdd(const degree &in) const", asMETHODPR(Radian, operator+,(const Degree&) const, Radian), asCALL_THISCALL);
1183  ROR_ASSERT( r >= 0 );
1184 
1185  r = engine->RegisterObjectMethod("radian", "radian &opAddAssign(const radian &in)", asMETHODPR(Radian,operator+=,(const Radian &),Radian&), asCALL_THISCALL);
1186  ROR_ASSERT( r >= 0 );
1187  r = engine->RegisterObjectMethod("radian", "radian &opAddAssign(const degree &in)", asMETHODPR(Radian,operator+=,(const Degree &),Radian&), asCALL_THISCALL);
1188  ROR_ASSERT( r >= 0 );
1189 
1190  r = engine->RegisterObjectMethod("radian", "radian opSub() const", asMETHODPR(Radian, operator-,() const, Radian), asCALL_THISCALL);
1191  ROR_ASSERT( r >= 0 );
1192  r = engine->RegisterObjectMethod("radian", "radian opSub(const radian &in) const", asMETHODPR(Radian, operator-,(const Radian&) const, Radian), asCALL_THISCALL);
1193  ROR_ASSERT( r >= 0 );
1194  r = engine->RegisterObjectMethod("radian", "radian opSub(const degree &in) const", asMETHODPR(Radian, operator-,(const Degree&) const, Radian), asCALL_THISCALL);
1195  ROR_ASSERT( r >= 0 );
1196 
1197  r = engine->RegisterObjectMethod("radian", "radian &opSubAssign(const radian &in)", asMETHODPR(Radian,operator-=,(const Radian &),Radian&), asCALL_THISCALL);
1198  ROR_ASSERT( r >= 0 );
1199  r = engine->RegisterObjectMethod("radian", "radian &opSubAssign(const degree &in)", asMETHODPR(Radian,operator-=,(const Degree &),Radian&), asCALL_THISCALL);
1200  ROR_ASSERT( r >= 0 );
1201 
1202  r = engine->RegisterObjectMethod("radian", "radian opMul(float) const", asMETHODPR(Radian, operator*,(float) const, Radian), asCALL_THISCALL);
1203  ROR_ASSERT( r >= 0 );
1204  r = engine->RegisterObjectMethod("radian", "radian opMul(const radian &in) const", asMETHODPR(Radian, operator*,(const Radian&) const, Radian), asCALL_THISCALL);
1205  ROR_ASSERT( r >= 0 );
1206 
1207  r = engine->RegisterObjectMethod("radian", "radian &opMulAssign(float)", asMETHODPR(Radian,operator*=,(float),Radian&), asCALL_THISCALL);
1208  ROR_ASSERT( r >= 0 );
1209 
1210  r = engine->RegisterObjectMethod("radian", "radian opDiv(float) const", asMETHODPR(Radian, operator/,(float) const, Radian), asCALL_THISCALL);
1211  ROR_ASSERT( r >= 0 );
1212 
1213  r = engine->RegisterObjectMethod("radian", "radian &opDivAssign(float)", asMETHODPR(Radian,operator*=,(float),Radian&), asCALL_THISCALL);
1214  ROR_ASSERT( r >= 0 );
1215 
1216  r = engine->RegisterObjectMethod("radian", "int opCmp(const radian &in) const", asFUNCTION(RadianCmp), asCALL_CDECL_OBJFIRST);
1217  ROR_ASSERT( r >= 0 );
1218 
1219  r = engine->RegisterObjectMethod("radian", "bool opEquals(const radian &in) const", asMETHODPR(Radian, operator==,(const Radian&) const, bool), asCALL_THISCALL);
1220  ROR_ASSERT( r >= 0 );
1221 
1222  // Register the object methods
1223  r = engine->RegisterObjectMethod("radian", "float valueDegrees() const", asMETHOD(Radian,valueDegrees), asCALL_THISCALL);
1224  ROR_ASSERT( r >= 0 );
1225  r = engine->RegisterObjectMethod("radian", "float valueRadians() const", asMETHOD(Radian,valueRadians), asCALL_THISCALL);
1226  ROR_ASSERT( r >= 0 );
1227  r = engine->RegisterObjectMethod("radian", "float valueAngleUnits() const", asMETHOD(Radian,valueAngleUnits), asCALL_THISCALL);
1228  ROR_ASSERT( r >= 0 );
1229 }
1230 
1231 void registerOgreDegree(AngelScript::asIScriptEngine* engine)
1232 {
1233  int r;
1234 
1235  // Register the object constructors
1236  r = engine->RegisterObjectBehaviour("degree", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(DegreeDefaultConstructor), asCALL_CDECL_OBJLAST);
1237  ROR_ASSERT( r >= 0 );
1238  r = engine->RegisterObjectBehaviour("degree", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(DegreeInitConstructor), asCALL_CDECL_OBJLAST);
1239  ROR_ASSERT( r >= 0 );
1240  r = engine->RegisterObjectBehaviour("degree", asBEHAVE_CONSTRUCT, "void f(const degree &in)", asFUNCTION(DegreeCopyConstructor), asCALL_CDECL_OBJLAST);
1241  ROR_ASSERT( r >= 0 );
1242 
1243  // Disabled during port to latest AngelScript because `asBEHAVE_IMPLICIT_VALUE_CAST` is deprecated.
1244  // TODO: Research and restore it ~ only_a_ptr, 08/2017
1245  // // Register other object behaviours
1246  // r = engine->RegisterObjectBehaviour("degree", asBEHAVE_IMPLICIT_VALUE_CAST, "float f() const", asMETHOD(Degree,valueDegrees), asCALL_THISCALL);
1247  // ROR_ASSERT( r >= 0 );
1248  // r = engine->RegisterObjectBehaviour("degree", asBEHAVE_IMPLICIT_VALUE_CAST, "double f() const", asMETHOD(Degree,valueDegrees), asCALL_THISCALL);
1249  // ROR_ASSERT( r >= 0 );
1250 
1251  // Register the object operators
1252  r = engine->RegisterObjectMethod("degree", "degree &opAssign(const degree &in)", asMETHODPR(Degree, operator =, (const Degree &), Degree&), asCALL_THISCALL);
1253  ROR_ASSERT( r >= 0 );
1254  r = engine->RegisterObjectMethod("degree", "degree &opAssign(float)", asMETHODPR(Degree, operator =, (const float &), Degree&), asCALL_THISCALL);
1255  ROR_ASSERT( r >= 0 );
1256  r = engine->RegisterObjectMethod("degree", "degree &opAssign(const radian &in)", asMETHODPR(Degree, operator =, (const Radian &), Degree&), asCALL_THISCALL);
1257  ROR_ASSERT( r >= 0 );
1258 
1259  r = engine->RegisterObjectMethod("degree", "degree opAdd() const", asMETHODPR(Degree, operator+,() const, const Degree&), asCALL_THISCALL);
1260  ROR_ASSERT( r >= 0 );
1261  r = engine->RegisterObjectMethod("degree", "degree opAdd(const degree &in) const", asMETHODPR(Degree, operator+,(const Degree&) const, Degree), asCALL_THISCALL);
1262  ROR_ASSERT( r >= 0 );
1263  r = engine->RegisterObjectMethod("degree", "degree opAdd(const radian &in) const", asMETHODPR(Degree, operator+,(const Radian&) const, Degree), asCALL_THISCALL);
1264  ROR_ASSERT( r >= 0 );
1265 
1266  r = engine->RegisterObjectMethod("degree", "degree &opAddAssign(const degree &in)", asMETHODPR(Degree,operator+=,(const Degree &),Degree&), asCALL_THISCALL);
1267  ROR_ASSERT( r >= 0 );
1268  r = engine->RegisterObjectMethod("degree", "degree &opAddAssign(const radian &in)", asMETHODPR(Degree,operator+=,(const Radian &),Degree&), asCALL_THISCALL);
1269  ROR_ASSERT( r >= 0 );
1270 
1271  r = engine->RegisterObjectMethod("degree", "degree opSub() const", asMETHODPR(Degree, operator-,() const, Degree), asCALL_THISCALL);
1272  ROR_ASSERT( r >= 0 );
1273  r = engine->RegisterObjectMethod("degree", "degree opSub(const degree &in) const", asMETHODPR(Degree, operator-,(const Degree&) const, Degree), asCALL_THISCALL);
1274  ROR_ASSERT( r >= 0 );
1275  r = engine->RegisterObjectMethod("degree", "degree opSub(const radian &in) const", asMETHODPR(Degree, operator-,(const Radian&) const, Degree), asCALL_THISCALL);
1276  ROR_ASSERT( r >= 0 );
1277 
1278  r = engine->RegisterObjectMethod("degree", "degree &opSubAssign(const degree &in)", asMETHODPR(Degree,operator-=,(const Degree &),Degree&), asCALL_THISCALL);
1279  ROR_ASSERT( r >= 0 );
1280  r = engine->RegisterObjectMethod("degree", "degree &opSubAssign(const radian &in)", asMETHODPR(Degree,operator-=,(const Radian &),Degree&), asCALL_THISCALL);
1281  ROR_ASSERT( r >= 0 );
1282 
1283  r = engine->RegisterObjectMethod("degree", "degree opMul(float) const", asMETHODPR(Degree, operator*,(float) const, Degree), asCALL_THISCALL);
1284  ROR_ASSERT( r >= 0 );
1285  r = engine->RegisterObjectMethod("degree", "degree opMul(const degree &in) const", asMETHODPR(Degree, operator*,(const Degree&) const, Degree), asCALL_THISCALL);
1286  ROR_ASSERT( r >= 0 );
1287 
1288  r = engine->RegisterObjectMethod("degree", "degree &opMulAssign(float)", asMETHODPR(Degree,operator*=,(float),Degree&), asCALL_THISCALL);
1289  ROR_ASSERT( r >= 0 );
1290 
1291  r = engine->RegisterObjectMethod("degree", "degree opDiv(float) const", asMETHODPR(Degree, operator/,(float) const, Degree), asCALL_THISCALL);
1292  ROR_ASSERT( r >= 0 );
1293 
1294  r = engine->RegisterObjectMethod("degree", "degree &opDivAssign(float)", asMETHODPR(Degree,operator*=,(float),Degree&), asCALL_THISCALL);
1295  ROR_ASSERT( r >= 0 );
1296 
1297  r = engine->RegisterObjectMethod("degree", "int opCmp(const degree &in) const", asFUNCTION(DegreeCmp), asCALL_CDECL_OBJFIRST);
1298  ROR_ASSERT( r >= 0 );
1299 
1300  r = engine->RegisterObjectMethod("degree", "bool opEquals(const degree &in) const", asMETHODPR(Degree, operator==,(const Degree&) const, bool), asCALL_THISCALL);
1301  ROR_ASSERT( r >= 0 );
1302 
1303  // Register the object methods
1304  r = engine->RegisterObjectMethod("degree", "float valueRadians() const", asMETHOD(Degree,valueRadians), asCALL_THISCALL);
1305  ROR_ASSERT( r >= 0 );
1306  r = engine->RegisterObjectMethod("degree", "float valueDegrees() const", asMETHOD(Degree,valueDegrees), asCALL_THISCALL);
1307  ROR_ASSERT( r >= 0 );
1308  r = engine->RegisterObjectMethod("degree", "float valueAngleUnits() const", asMETHOD(Degree,valueAngleUnits), asCALL_THISCALL);
1309  ROR_ASSERT( r >= 0 );
1310 }
1311 
1312 void registerOgreQuaternion(AngelScript::asIScriptEngine* engine)
1313 {
1314  int r;
1315 
1316  // Register the object properties
1317  r = engine->RegisterObjectProperty("quaternion", "float w", offsetof(Quaternion, w));
1318  ROR_ASSERT( r >= 0 );
1319  r = engine->RegisterObjectProperty("quaternion", "float x", offsetof(Quaternion, x));
1320  ROR_ASSERT( r >= 0 );
1321  r = engine->RegisterObjectProperty("quaternion", "float y", offsetof(Quaternion, y));
1322  ROR_ASSERT( r >= 0 );
1323  r = engine->RegisterObjectProperty("quaternion", "float z", offsetof(Quaternion, z));
1324  ROR_ASSERT( r >= 0 );
1325  // r = engine->RegisterObjectProperty("quaternion", "float ms_fEpsilon", offsetof(Quaternion, ms_fEpsilon)); ROR_ASSERT( r >= 0 );
1326  // r = engine->RegisterObjectProperty("quaternion", "quaternion ZERO", offsetof(Quaternion, ZERO)); ROR_ASSERT( r >= 0 );
1327  // r = engine->RegisterObjectProperty("quaternion", "quaternion IDENTITY", offsetof(Quaternion, IDENTITY)); ROR_ASSERT( r >= 0 );
1328 
1329  // Register the object constructors
1330  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(QuaternionDefaultConstructor), asCALL_CDECL_OBJLAST);
1331  ROR_ASSERT( r >= 0 );
1332  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f(const radian &in, const vector3 &in)", asFUNCTION(QuaternionInitConstructor1), asCALL_CDECL_OBJLAST);
1333  ROR_ASSERT( r >= 0 );
1334  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f(float, float, float, float)", asFUNCTION(QuaternionInitConstructor2), asCALL_CDECL_OBJLAST);
1335  ROR_ASSERT( r >= 0 );
1336  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f(const vector3 &in, const vector3 &in, const vector3 &in)", asFUNCTION(QuaternionInitConstructor3), asCALL_CDECL_OBJLAST);
1337  ROR_ASSERT( r >= 0 );
1338  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(QuaternionInitConstructorScaler), asCALL_CDECL_OBJLAST);
1339  ROR_ASSERT( r >= 0 );
1340  r = engine->RegisterObjectBehaviour("quaternion", asBEHAVE_CONSTRUCT, "void f(const quaternion &in)", asFUNCTION(QuaternionCopyConstructor), asCALL_CDECL_OBJLAST);
1341  ROR_ASSERT( r >= 0 );
1342 
1343  // Register the object operators
1344  r = engine->RegisterObjectMethod("quaternion", "float opIndex(int) const", asMETHODPR(Quaternion, operator[], (size_t) const, float), asCALL_THISCALL);
1345  ROR_ASSERT( r >= 0 );
1346  r = engine->RegisterObjectMethod("quaternion", "quaternion &opAssign(const quaternion &in)", asMETHODPR(Quaternion, operator =, (const Quaternion &), Quaternion&), asCALL_THISCALL);
1347  ROR_ASSERT( r >= 0 );
1348  r = engine->RegisterObjectMethod("quaternion", "quaternion opAdd(const quaternion &in) const", asMETHODPR(Quaternion, operator+,(const Quaternion&) const, Quaternion), asCALL_THISCALL);
1349  ROR_ASSERT( r >= 0 );
1350  r = engine->RegisterObjectMethod("quaternion", "quaternion opSub(const quaternion &in) const", asMETHODPR(Quaternion, operator-,(const Quaternion&) const, Quaternion), asCALL_THISCALL);
1351  ROR_ASSERT( r >= 0 );
1352  r = engine->RegisterObjectMethod("quaternion", "quaternion opMul(const quaternion &in) const", asMETHODPR(Quaternion, operator*,(const Quaternion&) const, Quaternion), asCALL_THISCALL);
1353  ROR_ASSERT( r >= 0 );
1354  r = engine->RegisterObjectMethod("quaternion", "quaternion opMul(float) const", asMETHODPR(Quaternion, operator*,(float) const, Quaternion), asCALL_THISCALL);
1355  ROR_ASSERT( r >= 0 );
1356  r = engine->RegisterObjectMethod("quaternion", "quaternion opSub() const", asMETHODPR(Quaternion, operator-,() const, Quaternion), asCALL_THISCALL);
1357  ROR_ASSERT( r >= 0 );
1358  r = engine->RegisterObjectMethod("quaternion", "bool opEquals(const quaternion &in) const", asMETHODPR(Quaternion, operator==,(const Quaternion&) const, bool), asCALL_THISCALL);
1359  ROR_ASSERT( r >= 0 );
1360  r = engine->RegisterObjectMethod("quaternion", "vector3 opMul(const vector3 &in) const", asMETHODPR(Quaternion, operator*,(const Vector3&) const, Vector3), asCALL_THISCALL);
1361  ROR_ASSERT( r >= 0 );
1362 
1363  // Register the object methods
1364  r = engine->RegisterObjectMethod("quaternion", "float Dot(const quaternion &in) const", asMETHOD(Quaternion,Dot), asCALL_THISCALL);
1365  ROR_ASSERT( r >= 0 );
1366  r = engine->RegisterObjectMethod("quaternion", "float Norm() const", asMETHOD(Quaternion,Norm), asCALL_THISCALL);
1367  ROR_ASSERT( r >= 0 );
1368  r = engine->RegisterObjectMethod("quaternion", "float normalise()", asMETHOD(Quaternion,normalise), asCALL_THISCALL);
1369  ROR_ASSERT( r >= 0 );
1370  r = engine->RegisterObjectMethod("quaternion", "quaternion Inverse() const", asMETHOD(Quaternion,Inverse), asCALL_THISCALL);
1371  ROR_ASSERT( r >= 0 );
1372  r = engine->RegisterObjectMethod("quaternion", "quaternion UnitInverse() const", asMETHOD(Quaternion,UnitInverse), asCALL_THISCALL);
1373  ROR_ASSERT( r >= 0 );
1374  r = engine->RegisterObjectMethod("quaternion", "quaternion Exp() const", asMETHOD(Quaternion,Exp), asCALL_THISCALL);
1375  ROR_ASSERT( r >= 0 );
1376  r = engine->RegisterObjectMethod("quaternion", "quaternion Log() const", asMETHOD(Quaternion,Log), asCALL_THISCALL);
1377  ROR_ASSERT( r >= 0 );
1378  r = engine->RegisterObjectMethod("quaternion", "radian getRoll(bool reprojectAxis = true) const", asMETHOD(Quaternion,getRoll), asCALL_THISCALL);
1379  ROR_ASSERT( r >= 0 );
1380  r = engine->RegisterObjectMethod("quaternion", "radian getPitch(bool reprojectAxis = true) const", asMETHOD(Quaternion,getPitch), asCALL_THISCALL);
1381  ROR_ASSERT( r >= 0 );
1382  r = engine->RegisterObjectMethod("quaternion", "radian getYaw(bool reprojectAxis = true) const", asMETHOD(Quaternion,getYaw), asCALL_THISCALL);
1383  ROR_ASSERT( r >= 0 );
1384  r = engine->RegisterObjectMethod("quaternion", "bool equals(const quaternion &in, const radian &in) const", asMETHOD(Quaternion,equals), asCALL_THISCALL);
1385  ROR_ASSERT( r >= 0 );
1386  r = engine->RegisterObjectMethod("quaternion", "bool isNaN() const", asMETHOD(Quaternion,isNaN), asCALL_THISCALL);
1387  ROR_ASSERT( r >= 0 );
1388 
1389  // Register some static methods
1390  r = engine->RegisterGlobalFunction("quaternion Slerp(float, const quaternion &in, const quaternion &in, bool &in)", asFUNCTIONPR(Quaternion::Slerp,(Real fT, const Quaternion&, const Quaternion&, bool), Quaternion), asCALL_CDECL);
1391  ROR_ASSERT( r >= 0 );
1392  r = engine->RegisterGlobalFunction("quaternion SlerpExtraSpins(float, const quaternion &in, const quaternion &in, int &in)", asFUNCTION(Quaternion::SlerpExtraSpins), asCALL_CDECL);
1393  ROR_ASSERT( r >= 0 );
1394  r = engine->RegisterGlobalFunction("void Intermediate(const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in)", asFUNCTION(Quaternion::Intermediate), asCALL_CDECL);
1395  ROR_ASSERT( r >= 0 );
1396  r = engine->RegisterGlobalFunction("quaternion Squad(float, const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in, bool &in)", asFUNCTION(Quaternion::Squad), asCALL_CDECL);
1397  ROR_ASSERT( r >= 0 );
1398  r = engine->RegisterGlobalFunction("quaternion nlerp(float, const quaternion &in, const quaternion &in, bool &in)", asFUNCTION(Quaternion::nlerp), asCALL_CDECL);
1399  ROR_ASSERT( r >= 0 );
1400 }
1401 
1402 void registerOgreColourValue(AngelScript::asIScriptEngine* engine)
1403 {
1404  int r;
1405 
1406  // Register the object properties
1407  r = engine->RegisterObjectProperty("color", "float r", offsetof(ColourValue, r));
1408  ROR_ASSERT( r >= 0 );
1409  r = engine->RegisterObjectProperty("color", "float g", offsetof(ColourValue, g));
1410  ROR_ASSERT( r >= 0 );
1411  r = engine->RegisterObjectProperty("color", "float b", offsetof(ColourValue, b));
1412  ROR_ASSERT( r >= 0 );
1413  r = engine->RegisterObjectProperty("color", "float a", offsetof(ColourValue, a));
1414  ROR_ASSERT( r >= 0 );
1415 
1416  // Register the object constructors
1417  r = engine->RegisterObjectBehaviour("color", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ColourValueDefaultConstructor), asCALL_CDECL_OBJLAST);
1418  ROR_ASSERT( r >= 0 );
1419  r = engine->RegisterObjectBehaviour("color", asBEHAVE_CONSTRUCT, "void f(float r, float g, float b, float a)", asFUNCTION(ColourValueInitConstructor), asCALL_CDECL_OBJLAST);
1420  ROR_ASSERT( r >= 0 );
1421  r = engine->RegisterObjectBehaviour("color", asBEHAVE_CONSTRUCT, "void f(const color &other)", asFUNCTION(QuaternionCopyConstructor), asCALL_CDECL_OBJLAST);
1422 }
1423 
1424 void registerOgreBox(AngelScript::asIScriptEngine* engine)
1425 {
1426  int r;
1427 
1428  // Register the object properties
1429  r = engine->RegisterObjectProperty("box", "uint left", offsetof(Box, left));
1430  ROR_ASSERT( r >= 0 );
1431  r = engine->RegisterObjectProperty("box", "uint top", offsetof(Box, top));
1432  ROR_ASSERT( r >= 0 );
1433  r = engine->RegisterObjectProperty("box", "uint right", offsetof(Box, right));
1434  ROR_ASSERT( r >= 0 );
1435  r = engine->RegisterObjectProperty("box", "uint bottom", offsetof(Box, bottom));
1436  ROR_ASSERT( r >= 0 );
1437  r = engine->RegisterObjectProperty("box", "uint front", offsetof(Box, front));
1438  ROR_ASSERT( r >= 0 );
1439  r = engine->RegisterObjectProperty("box", "uint back", offsetof(Box, back));
1440  ROR_ASSERT( r >= 0 );
1441 
1442  // Register the object constructors
1443  r = engine->RegisterObjectBehaviour("box", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(BoxDefaultConstructor), asCALL_CDECL_OBJLAST);
1444  ROR_ASSERT( r >= 0 );
1445  r = engine->RegisterObjectBehaviour("box", asBEHAVE_CONSTRUCT, "void f(uint32 l, uint32 t, uint32 r, uint32 b)", asFUNCTION(BoxInitConstructor), asCALL_CDECL_OBJLAST);
1446  ROR_ASSERT( r >= 0 );
1447  r = engine->RegisterObjectBehaviour("box", asBEHAVE_CONSTRUCT, "void f(const box &other)", asFUNCTION(BoxCopyConstructor), asCALL_CDECL_OBJLAST);
1448 
1449  // Register other behaviors
1450  r = engine->RegisterObjectBehaviour("box", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(BoxDestructor), asCALL_CDECL_OBJLAST);
1451  ROR_ASSERT(r >= 0);
1452  r = engine->RegisterObjectMethod("box", "box& opAssign(const box&in)", asFUNCTION(BoxAssignOperator), asCALL_CDECL_OBJLAST);
1453  ROR_ASSERT(r >= 0);
1454 }
1455 
1456 void registerOgreTexture(AngelScript::asIScriptEngine* engine)
1457 {
1458  int r;
1459  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1460 
1461  r = engine->RegisterObjectBehaviour("TexturePtr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(TexturePtrDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1462  r = engine->RegisterObjectBehaviour("TexturePtr", asBEHAVE_CONSTRUCT, "void f(const TexturePtr&in)", asFUNCTION(TexturePtrCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1463  r = engine->RegisterObjectBehaviour("TexturePtr", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(TexturePtrDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1464  r = engine->RegisterObjectMethod("TexturePtr", "TexturePtr& opAssign(const TexturePtr&in)", asFUNCTION(TexturePtrAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1465  r = engine->RegisterObjectMethod("TexturePtr", "bool isNull()", asFUNCTION(TexturePtrIsNull), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1466 
1467  // Wrappers are inevitable, see https://www.gamedev.net/forums/topic/540419-custom-smartpointers-and-angelscript-/
1468  r = engine->RegisterObjectMethod("TexturePtr", "string getName() const", asFUNCTIONPR([](TexturePtr const& self) {
1469  return self->getName();
1470  }, (TexturePtr const&), Ogre::String), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1471  r = engine->RegisterObjectMethod("TexturePtr", "uint getWidth()", asFUNCTIONPR([](TexturePtr const& self) {
1472  return (asUINT)self->getWidth();
1473  }, (TexturePtr const&), Ogre::uint32), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1474  r = engine->RegisterObjectMethod("TexturePtr", "uint getHeight()", asFUNCTIONPR([](TexturePtr const& self) {
1475  return (asUINT)self->getHeight();
1476  }, (TexturePtr const&), Ogre::uint32), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1477  r = engine->RegisterObjectMethod("TexturePtr", "uint getNumMipmaps()", asFUNCTIONPR([](TexturePtr const& self) {
1478  return (asUINT)self->getNumMipmaps();
1479  }, (TexturePtr const&), Ogre::uint32), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1480  r = engine->RegisterObjectMethod("TexturePtr", "HardwarePixelBufferPtr getBuffer(uint, uint)", asFUNCTIONPR([](TexturePtr const& self, asUINT face, asUINT mipmap) {
1481  return self->getBuffer(face, mipmap);
1482  }, (TexturePtr const&, asUINT, asUINT), HardwarePixelBufferSharedPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1483 
1484  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1485 }
1486 
1487 void registerOgreTextureManager(AngelScript::asIScriptEngine * engine)
1488 {
1489  int r;
1490  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1491 
1492  // Convenience wrapper to omit optional parameters
1493  r = engine->RegisterObjectMethod("TextureManager", "TexturePtr load(const string&in file, const string&in rg)", asFUNCTIONPR([](TextureManager& mgr, std::string const& file, std::string const& rg){
1494  try { return mgr.load(file, rg); }
1495  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::TextureManager::load()"); return Ogre::TexturePtr();}
1496  }, (TextureManager& mgr, std::string const& file, std::string const& rg), TexturePtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1497 
1498  r = engine->SetDefaultNamespace("Ogre::TextureManager"); ROR_ASSERT(r >= 0);
1499  r = engine->RegisterGlobalFunction("TextureManager& getSingleton()", asFUNCTION(TextureManager::getSingleton), asCALL_CDECL); ROR_ASSERT(r >= 0);
1500 
1501  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1502 }
1503 
1504 template <typename T>
1505 void registerOgreMovableObjectBase(AngelScript::asIScriptEngine* engine, const char* obj)
1506 {
1507  int r;
1508  r = engine->RegisterObjectMethod(obj, "string __getUniqueName() const", asFUNCTION(MovableObjectGetUniqueNameMixin), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1509 
1510  r = engine->RegisterObjectMethod(obj, "const string& getName() const", asMETHOD(MovableObject, getName), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1511  r = engine->RegisterObjectMethod(obj, "const string& getMovableType() const", asMETHOD(MovableObject, getMovableType), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1512 
1513  r = engine->RegisterObjectMethod(obj, "Node@ getParentNode()", asMETHOD(MovableObject, getParentNode), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1514  r = engine->RegisterObjectMethod(obj, "SceneNode@ getParentSceneNode()", asMETHOD(MovableObject, getParentSceneNode), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1515  r = engine->RegisterObjectMethod(obj, "bool isParentTagPoint() const", asMETHOD(MovableObject, isParentTagPoint), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1516  r = engine->RegisterObjectMethod(obj, "bool isAttached() const", asMETHOD(MovableObject, isAttached), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1517  r = engine->RegisterObjectMethod(obj, "void detachFromParent()", asMETHOD(MovableObject, detachFromParent), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1518 
1519  r = engine->RegisterObjectMethod(obj, "bool isInScene() const", asMETHOD(MovableObject, isInScene), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1520  r = engine->RegisterObjectMethod(obj, "float getBoundingRadius() const", asMETHOD(MovableObject, getBoundingRadius), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1521 
1522  r = engine->RegisterObjectMethod(obj, "void setVisible(bool visible)", asMETHOD(MovableObject, setVisible), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1523  r = engine->RegisterObjectMethod(obj, "bool getVisible() const", asMETHOD(MovableObject, getVisible), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1524  r = engine->RegisterObjectMethod(obj, "bool isVisible() const", asMETHOD(MovableObject, isVisible), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1525 
1526  r = engine->RegisterObjectMethod(obj, "void setRenderingDistance(float dist)", asMETHOD(MovableObject, setRenderingDistance), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1527  r = engine->RegisterObjectMethod(obj, "float getRenderingDistance() const", asMETHOD(MovableObject, getRenderingDistance), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1528 
1529  r = engine->RegisterObjectMethod(obj, "void setRenderingMinPixelSize(float pixelSize)", asMETHOD(MovableObject, setRenderingMinPixelSize), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1530  r = engine->RegisterObjectMethod(obj, "float getRenderingMinPixelSize() const", asMETHOD(MovableObject, getRenderingMinPixelSize), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1531 
1532  r = engine->RegisterObjectMethod(obj, "void setCastShadows(bool enabled)", asMETHOD(MovableObject, setCastShadows), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1533  r = engine->RegisterObjectMethod(obj, "bool getCastShadows() const", asMETHOD(MovableObject, getCastShadows), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1534 }
1535 
1536 void registerOgreMovableObject(AngelScript::asIScriptEngine* engine)
1537 {
1538  int r;
1539  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1540 
1541  registerOgreMovableObjectBase<MovableObject>(engine, "MovableObject");
1542 
1543  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1544 }
1545 
1546 void registerOgreEntity(AngelScript::asIScriptEngine* engine)
1547 {
1548  int r;
1549  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1550 
1551  r = engine->RegisterObjectMethod("Entity", "AnimationState @getAnimationState(const string &in) const", asMETHOD(Entity, getAnimationState), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1552  r = engine->RegisterObjectMethod("Entity", "AnimationStateSet @getAllAnimationStates()", asMETHOD(Entity, getAllAnimationStates), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1553  r = engine->RegisterObjectMethod("Entity", "void setDisplaySkeleton(bool)", asMETHOD(Entity, setDisplaySkeleton), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1554  r = engine->RegisterObjectMethod("Entity", "bool getDisplaySkeleton() const", asMETHOD(Entity, getDisplaySkeleton), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1555  r = engine->RegisterObjectMethod("Entity", "uint64 getNumManualLodLevels() const", asMETHOD(Entity, getNumManualLodLevels), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1556  r = engine->RegisterObjectMethod("Entity", "uint16 getCurrentLodIndex()", asMETHOD(Entity, getCurrentLodIndex), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1557  r = engine->RegisterObjectMethod("Entity", "Entity @getManualLodLevel(uint64) const", asMETHOD(Entity, getManualLodLevel), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1558  r = engine->RegisterObjectMethod("Entity", "void setMeshLodBias(float, uint16, uint16)", asMETHOD(Entity, setMeshLodBias), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1559  r = engine->RegisterObjectMethod("Entity", "void setMaterialLodBias(float, uint16, uint16)", asMETHOD(Entity, setMaterialLodBias), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1560  r = engine->RegisterObjectMethod("Entity", "SubEntityArray @getSubEntities() const", asFUNCTION(EntityGetSubEntities), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1561  r = engine->RegisterObjectMethod("Entity", "const MeshPtr& getMesh() const", asMETHOD(Entity, getMesh), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1562 
1563  registerOgreMovableObjectBase<MovableObject>(engine, "Entity");
1564 
1565  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1566 }
1567 
1568 void registerOgreSubEntity(AngelScript::asIScriptEngine* engine)
1569 {
1570  int r;
1571  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1572 
1573  r = engine->RegisterObjectMethod("SubEntity", "const MaterialPtr& getMaterial() const", asMETHOD(SubEntity, getMaterial), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1574  r = engine->RegisterObjectMethod("SubEntity", "void setMaterial(const MaterialPtr&in)", asMETHOD(SubEntity, setMaterial), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1575  r = engine->RegisterObjectMethod("SubEntity", "SubMesh@ getSubMesh()", asMETHOD(SubEntity, getSubMesh), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1576 
1577  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1578 }
1579 
1580 template <typename T>
1581 void registerOgreNodeBase(AngelScript::asIScriptEngine* engine, const char* obj)
1582 {
1583  int r;
1584  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1585 
1586  r = engine->RegisterObjectMethod(obj, "const vector3& getPosition() const", asMETHOD(T, getPosition), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1587  r = engine->RegisterObjectMethod(obj, "void setPosition(const vector3 &in)", asMETHODPR(T, setPosition, (const Vector3&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1588 
1589  r = engine->RegisterObjectMethod(obj, "const vector3& getScale() const", asMETHOD(T, getScale), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1590  r = engine->RegisterObjectMethod(obj, "void setScale(const vector3 &in)", asMETHODPR(T, setScale, (const Ogre::Vector3&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1591 
1592  r = engine->RegisterObjectMethod(obj, "const string& getName() const", asMETHOD(T, getName), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1593  r = engine->RegisterObjectMethod(obj, "Node@ getParent()", asMETHOD(T, getParent), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1594 
1595  r = engine->RegisterObjectMethod(obj, "const quaternion& getOrientation() const", asMETHOD(T, getOrientation), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1596  r = engine->RegisterObjectMethod(obj, "void setOrientation(const quaternion&in)", asFUNCTIONPR([](T* self, const Ogre::Quaternion& q){
1597  self->setOrientation(q);
1598  }, (T*, const Quaternion&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1599 
1600  r = engine->RegisterObjectMethod(obj, "string __getUniqueName() const", asFUNCTION(NodeGetUniqueNameMixin), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1601 
1602  // Not const because we don't want all elements to be const (this isn't the case with raw pointers in C++).
1603  r = engine->RegisterObjectMethod(obj, "ChildNodeArray@ getChildren()", asFUNCTION(NodeGetChildren), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1604 
1605  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1606 }
1607 
1608 void registerOgreNode(AngelScript::asIScriptEngine* engine)
1609 {
1610  int r;
1611  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1612 
1613  registerOgreNodeBase<Node>(engine, "Node");
1614 
1615  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1616 }
1617 
1618 void registerOgreSceneNode(AngelScript::asIScriptEngine* engine)
1619 {
1620  int r;
1621  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1622 
1623  r = engine->RegisterObjectMethod("SceneNode", "void attachObject(MovableObject@ obj)", asMETHODPR(SceneNode, attachObject, (MovableObject*), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1624  r = engine->RegisterObjectMethod("SceneNode", "MovableObject@ getAttachedObject(const string& in)", asMETHODPR(SceneNode, getAttachedObject, (const String&), MovableObject*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1625  r = engine->RegisterObjectMethod("SceneNode", "MovableObject@ detachObject(uint16)", asMETHODPR(SceneNode, detachObject, (uint16), MovableObject*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1626  r = engine->RegisterObjectMethod("SceneNode", "void detachObject(MovableObject@ obj)", asMETHODPR(SceneNode, detachObject, (MovableObject*), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1627  r = engine->RegisterObjectMethod("SceneNode", "MovableObject@ detachObject(const string& in)", asMETHODPR(SceneNode, detachObject, (const String&), MovableObject*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1628  r = engine->RegisterObjectMethod("SceneNode", "void detachAllObjects()", asMETHOD(SceneNode, detachAllObjects), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1629  r = engine->RegisterObjectMethod("SceneNode", "bool isInSceneGraph() const", asMETHOD(SceneNode, isInSceneGraph), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1630  r = engine->RegisterObjectMethod("SceneNode", "SceneManager@ getCreator() const", asMETHOD(SceneNode, getCreator), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1631  r = engine->RegisterObjectMethod("SceneNode", "void removeAndDestroyChild(const string& in)", asMETHODPR(SceneNode, removeAndDestroyChild, (const String&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1632  r = engine->RegisterObjectMethod("SceneNode", "void removeAndDestroyChild(uint16)", asMETHODPR(SceneNode, removeAndDestroyChild, (uint16), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1633  r = engine->RegisterObjectMethod("SceneNode", "void removeAndDestroyChild(SceneNode@)", asMETHODPR(SceneNode, removeAndDestroyChild, (uint16), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1634  r = engine->RegisterObjectMethod("SceneNode", "void removeAndDestroyAllChildren()", asMETHOD(SceneNode, removeAndDestroyAllChildren), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1635  r = engine->RegisterObjectMethod("SceneNode", "void showBoundingBox(bool bShow)", asMETHOD(SceneNode, showBoundingBox), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1636  r = engine->RegisterObjectMethod("SceneNode", "void hideBoundingBox(bool bHide)", asMETHOD(SceneNode, hideBoundingBox), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1637  r = engine->RegisterObjectMethod("SceneNode", "bool getShowBoundingBox() const", asMETHOD(SceneNode, getShowBoundingBox), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1638  r = engine->RegisterObjectMethod("SceneNode", "SceneNode@ createChildSceneNode(const string& in name, const vector3& in translate = vector3(0.f, 0.f, 0.f), const quaternion& in rotate = quaternion())", asMETHODPR(SceneNode, createChildSceneNode, (const String&, const Vector3&, const Quaternion&), SceneNode*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1639  r = engine->RegisterObjectMethod("SceneNode", "void setFixedYawAxis(bool useFixed, const vector3& in fixedAxis = vector3(0.f, 1.f, 0.f))", asMETHOD(SceneNode, setFixedYawAxis), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1640  r = engine->RegisterObjectMethod("SceneNode", "void yaw(const radian& in angle, TransformSpace relativeTo = Ogre::TS_LOCAL)", asMETHOD(SceneNode, yaw), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1641  r = engine->RegisterObjectMethod("SceneNode", "void setDirection(const vector3& in vec, TransformSpace relativeTo = Ogre::TS_LOCAL, const vector3& in localDirectionVector = vector3(0.f, 0.f, -1.f))", asMETHODPR(SceneNode, setDirection, (const Vector3&, Node::TransformSpace, const Vector3&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1642  r = engine->RegisterObjectMethod("SceneNode", "SceneNode@ getParentSceneNode() const", asMETHOD(SceneNode, getParentSceneNode), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1643  // Not const because we don't want all elements to be const (this isn't the case with raw pointers in C++).
1644  r = engine->RegisterObjectMethod("SceneNode", "MovableObjectArray@ getAttachedObjects()", asFUNCTION(SceneNodeGetAttachedObjects), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1645  r = engine->RegisterObjectMethod("SceneNode", "void lookAt(const vector3 &in, TransformSpace, const vector3 &in = vector3(0,0,-1))", asMETHODPR(SceneNode, lookAt, (const Vector3&, Node::TransformSpace, const Vector3&), void), asCALL_THISCALL);
1646  r = engine->RegisterObjectMethod("SceneNode", "void setAutoTracking(bool, SceneNode@, const vector3 &in = vector3(0,0,-1), const vector3 &in = vector3())", asMETHODPR(SceneNode, setAutoTracking, (bool, SceneNode* const, const Vector3&, const Vector3&), void), asCALL_THISCALL);
1647  r = engine->RegisterObjectMethod("SceneNode", "SceneNode@ getAutoTrackTarget()", asMETHODPR(SceneNode, getAutoTrackTarget, (), SceneNode*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1648  r = engine->RegisterObjectMethod("SceneNode", "const vector3& getAutoTrackOffset()", asMETHODPR(SceneNode, getAutoTrackOffset, (), const Vector3&), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1649  r = engine->RegisterObjectMethod("SceneNode", "const vector3& getAutoTrackLocalDirection()", asMETHODPR(SceneNode, getAutoTrackLocalDirection, (), const Vector3&), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1650  r = engine->RegisterObjectMethod("SceneNode", "SceneNode@ getParentSceneNode()", asMETHODPR(SceneNode, getParentSceneNode, () const, SceneNode*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1651  r = engine->RegisterObjectMethod("SceneNode", "void setVisible(bool, bool cascade = true)", asMETHODPR(SceneNode, setVisible, (bool, bool), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1652  r = engine->RegisterObjectMethod("SceneNode", "void flipVisibility(bool = true)", asMETHODPR(SceneNode, flipVisibility, (bool), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1653  r = engine->RegisterObjectMethod("SceneNode", "void setDebugDisplayEnabled(bool, bool cascade = true)", asMETHODPR(SceneNode, setDebugDisplayEnabled, (bool, bool), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1654 
1655  registerOgreNodeBase<SceneNode>(engine, "SceneNode");
1656 
1657  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1658 }
1659 
1660 void registerOgreSceneManager(AngelScript::asIScriptEngine* engine)
1661 {
1662  int r;
1663  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1664 
1665  r = engine->RegisterObjectMethod("SceneManager", "Entity@ createEntity(const string&in ent_name, const string &in mesh_name, const string &in mesh_rg = \"OgreAutodetect\")", asFUNCTIONPR([](Ogre::SceneManager* self, const std::string& entityName, const std::string& meshName, const std::string& meshRG) -> Ogre::Entity* {
1666  try { return self->createEntity(entityName, meshName, meshRG); }
1667  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::SceneManager::createEntity()"); return nullptr; }
1668  }, (Ogre::SceneManager* , const std::string& , const std::string& , const std::string& ), Ogre::Entity*), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1669  r = engine->RegisterObjectMethod("SceneManager", "const string& getName() const", asMETHOD(SceneManager, getName), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1670  r = engine->RegisterObjectMethod("SceneManager", "SceneNode@ getRootSceneNode()", asMETHOD(SceneManager, getRootSceneNode), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1671  r = engine->RegisterObjectMethod("SceneManager", "void destroyEntity(Entity@)", asMETHODPR(SceneManager, destroyEntity, (Entity*), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1672  r = engine->RegisterObjectMethod("SceneManager", "void destroyEntity(const string &in)", asMETHODPR(SceneManager, destroyEntity, (const Ogre::String&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1673  r = engine->RegisterObjectMethod("SceneManager", "void destroySceneNode(SceneNode@)", asMETHODPR(SceneManager, destroySceneNode, (SceneNode*), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1674  r = engine->RegisterObjectMethod("SceneManager", "void destroySceneNode(const string &in)", asMETHODPR(SceneManager, destroySceneNode, (const Ogre::String&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1675 
1676  // ManualObject:
1677  r = engine->RegisterObjectMethod("SceneManager", "ManualObject@ createManualObject(const string &in)", asMETHODPR(SceneManager, createManualObject, (const Ogre::String&), Ogre::ManualObject*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1678  r = engine->RegisterObjectMethod("SceneManager", "ManualObject@ getManualObject(const string &in)", asMETHODPR(SceneManager, getManualObject, (const Ogre::String&) const, Ogre::ManualObject*), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1679  r = engine->RegisterObjectMethod("SceneManager", "ManualObject@ destroyManualObject(const string &in)", asMETHODPR(SceneManager, destroyManualObject, (const Ogre::String&), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1680  r = engine->RegisterObjectMethod("SceneManager", "void destroyManualObject(ManualObject@)", asMETHODPR(SceneManager, destroyManualObject, (Ogre::ManualObject*), void), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1681 
1682  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1683 }
1684 
1685 void registerOgreRoot(AngelScript::asIScriptEngine* engine)
1686 {
1687  int r;
1688  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1689 
1690  r = engine->RegisterObjectMethod("Root", "SceneManagerInstanceDict@ getSceneManagers()", asFUNCTION(RootGetSceneManagers), asCALL_CDECL_OBJLAST);
1691 
1692  r = engine->SetDefaultNamespace("Ogre::Root");
1693  r = engine->RegisterGlobalFunction("Root& getSingleton()", asFUNCTION(Root::getSingleton), asCALL_CDECL);
1694 
1695  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1696 }
1697 
1698 void registerOgreAnimationState(AngelScript::asIScriptEngine* engine)
1699 {
1700  int r;
1701  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1702 
1703  // Register the getters and setters
1704  r = engine->RegisterObjectMethod("AnimationState", "const string& getAnimationName() const", asMETHOD(AnimationState, getAnimationName), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1705  r = engine->RegisterObjectMethod("AnimationState", "float getTimePosition() const", asMETHOD(AnimationState, getTimePosition), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1706  r = engine->RegisterObjectMethod("AnimationState", "void setTimePosition(float)", asMETHOD(AnimationState, setTimePosition), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1707  r = engine->RegisterObjectMethod("AnimationState", "float getLength() const", asMETHOD(AnimationState, getLength), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1708  r = engine->RegisterObjectMethod("AnimationState", "void setLength(float)", asMETHOD(AnimationState, setLength), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1709  r = engine->RegisterObjectMethod("AnimationState", "float getWeight() const", asMETHOD(AnimationState, getWeight), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1710  r = engine->RegisterObjectMethod("AnimationState", "void setWeight(float)", asMETHOD(AnimationState, setWeight), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1711  r = engine->RegisterObjectMethod("AnimationState", "void addTime(float)", asMETHOD(AnimationState, addTime), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1712  r = engine->RegisterObjectMethod("AnimationState", "bool hasEnded() const", asMETHOD(AnimationState, hasEnded), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1713  r = engine->RegisterObjectMethod("AnimationState", "bool getEnabled() const", asMETHOD(AnimationState, getEnabled), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1714  r = engine->RegisterObjectMethod("AnimationState", "void setEnabled(bool)", asMETHOD(AnimationState, setEnabled), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1715  r = engine->RegisterObjectMethod("AnimationState", "void setLoop(bool)", asMETHOD(AnimationState, setLoop), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1716  r = engine->RegisterObjectMethod("AnimationState", "bool getLoop() const", asMETHOD(AnimationState, getLoop), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1717  r = engine->RegisterObjectMethod("AnimationState", "AnimationStateSet@ getParent()", asMETHOD(AnimationState, getParent), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1718  r = engine->RegisterObjectMethod("AnimationState", "void createBlendMask(uint blendMaskSizeHint, float initialWeight = 1.0f)", asMETHOD(AnimationState, createBlendMask), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1719  r = engine->RegisterObjectMethod("AnimationState", "void destroyBlendMask()", asMETHOD(AnimationState, destroyBlendMask), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1720  r = engine->RegisterObjectMethod("AnimationState", "bool hasBlendMask() const", asMETHOD(AnimationState, hasBlendMask), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1721  r = engine->RegisterObjectMethod("AnimationState", "void setBlendMaskEntry(uint boneHandle, float weight)", asMETHOD(AnimationState, setBlendMaskEntry), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1722  r = engine->RegisterObjectMethod("AnimationState", "float getBlendMaskEntry(uint boneHandle)", asMETHOD(AnimationState, getBlendMaskEntry), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1723 
1724  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1725 }
1726 
1727 void registerOgreAnimationStateSet(AngelScript::asIScriptEngine* engine)
1728 {
1729  int r;
1730  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1731 
1732  r = engine->RegisterObjectMethod("AnimationStateSet", "AnimationState@ createAnimationState(const string& in, float, float, float = 1.0f, bool = false)", asMETHOD(AnimationStateSet, createAnimationState), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1733  r = engine->RegisterObjectMethod("AnimationStateSet", "AnimationState@ getAnimationState(const string& in) const", asMETHOD(AnimationStateSet, getAnimationState), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1734  r = engine->RegisterObjectMethod("AnimationStateSet", "bool hasAnimationState(const string& in) const", asMETHOD(AnimationStateSet, hasAnimationState), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1735  r = engine->RegisterObjectMethod("AnimationStateSet", "void removeAnimationState(const string& in)", asMETHOD(AnimationStateSet, removeAnimationState), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1736  r = engine->RegisterObjectMethod("AnimationStateSet", "void removeAllAnimationStates()", asMETHOD(AnimationStateSet, removeAllAnimationStates), asCALL_THISCALL); ROR_ASSERT(r >= 0);
1737  r = engine->RegisterObjectMethod("AnimationStateSet", "AnimationStateDict@ getAnimationStates()", asFUNCTION(AnimationStateSetGetAnimationStates), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1738 
1739  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
1740 }
1741 
1742 AngelScript::CScriptArray* get2DElementsHelper(Ogre::Overlay* self)
1743 {
1744  try {
1745  const Ogre::Overlay::OverlayContainerList& ocList = self->get2DElements();
1746  AngelScript::asITypeInfo* typeinfo = App::GetScriptEngine()->getEngine()->GetTypeInfoByDecl("array<Ogre::OverlayElement@>");
1747  AngelScript::CScriptArray* arr = AngelScript::CScriptArray::Create(typeinfo);
1748  for (OverlayContainer* oc: ocList)
1749  {
1750  OverlayElement* elem = static_cast<Ogre::OverlayElement*>(oc);
1751  arr->InsertLast(&elem); // TORN HAIR HERE!! Don't forget to pass ref-types as pointer-to-pointer!!
1752  }
1753  return arr;
1754  }
1755  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Overlay::get2DElements()"); return (CScriptArray*)nullptr; }
1756 }
1757 
1758 AngelScript::CScriptArray* getElementTemplatesHelper(Ogre::OverlayManager* self)
1759 {
1760  try {
1761  auto iterable = self->getTemplateIterator();
1762  // we must cast on the go (unlike get2DElements() this actually returns list of Ogre::OverlayElement*), see ATTENTION! below.
1763  AngelScript::asITypeInfo* typeinfo = App::GetScriptEngine()->getEngine()->GetTypeInfoByDecl("array<Ogre::OverlayElement@>");
1764  AngelScript::CScriptArray* arr = AngelScript::CScriptArray::Create(typeinfo);
1765  for (auto& elem_pair: iterable) {
1766  OverlayElement* elem = static_cast<Ogre::OverlayElement*>(elem_pair.second);
1767  arr->InsertLast(&elem); // TORN HAIR HERE!! Don't forget to pass ref-types as pointer-to-pointer!!
1768  }
1769  return arr; }
1770  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::getTemplates()"); return (CScriptArray*)nullptr; }
1771 }
1772 
1773 void registerOgreOverlay(AngelScript::asIScriptEngine* engine)
1774 {
1775  engine->SetDefaultNamespace("Ogre");
1776 
1777  // Register the GuiMetricsMode enum
1778  engine->RegisterEnum("GuiMetricsMode");
1779  engine->RegisterEnumValue("GuiMetricsMode", "GMM_PIXELS", Ogre::GMM_PIXELS);
1780  engine->RegisterEnumValue("GuiMetricsMode", "GMM_RELATIVE", Ogre::GMM_RELATIVE);
1781  engine->RegisterEnumValue("GuiMetricsMode", "GMM_RELATIVE_ASPECT_ADJUSTED", Ogre::GMM_RELATIVE_ASPECT_ADJUSTED);
1782 
1783  // Register the GuiHorizontalAlignment enum
1784  engine->RegisterEnum("GuiHorizontalAlignment");
1785  engine->RegisterEnumValue("GuiHorizontalAlignment", "GHA_LEFT", Ogre::GHA_LEFT);
1786  engine->RegisterEnumValue("GuiHorizontalAlignment", "GHA_CENTER", Ogre::GHA_CENTER);
1787  engine->RegisterEnumValue("GuiHorizontalAlignment", "GHA_RIGHT", Ogre::GHA_RIGHT);
1788 
1789 
1790  // Register the OverlayElement class
1791  // ATTENTION! only instances of `OverlayContainer` (is-a `OverlayElement`) can actually be bound to overlays and retrieved from overlays
1792  // - see `Ogre::Overlay::add2D()`, `Ogre::Overlay::get2DElements()` and APIDOC on `OverlayContainer`.
1793  // This forces us to toss `dynamic_cast<>`s around :(
1794  // (order roughly matches OgreOverlayElement.h)
1795  engine->RegisterObjectType("OverlayElement", 0, asOBJ_REF | asOBJ_NOCOUNT);
1796  engine->RegisterObjectMethod("OverlayElement", "const string& getName() const", asMETHOD(Ogre::OverlayElement, getName), asCALL_THISCALL);
1797  // > visibility
1798  engine->RegisterObjectMethod("OverlayElement", "void show()", asMETHOD(Ogre::OverlayElement, show), asCALL_THISCALL);
1799  engine->RegisterObjectMethod("OverlayElement", "void hide()", asMETHOD(Ogre::OverlayElement, hide), asCALL_THISCALL);
1800  engine->RegisterObjectMethod("OverlayElement", "bool isVisible() const", asMETHOD(Ogre::OverlayElement, isVisible), asCALL_THISCALL);
1801  // > positioning
1802  engine->RegisterObjectMethod("OverlayElement", "void setPosition(float, float)", asMETHOD(Ogre::OverlayElement, setPosition), asCALL_THISCALL);
1803  engine->RegisterObjectMethod("OverlayElement", "void setDimensions(float, float)", asMETHOD(Ogre::OverlayElement, setDimensions), asCALL_THISCALL);
1804  engine->RegisterObjectMethod("OverlayElement", "float getLeft() const", asMETHOD(Ogre::OverlayElement, getLeft), asCALL_THISCALL);
1805  engine->RegisterObjectMethod("OverlayElement", "float getTop() const", asMETHOD(Ogre::OverlayElement, getTop), asCALL_THISCALL);
1806  engine->RegisterObjectMethod("OverlayElement", "float getWidth() const", asMETHOD(Ogre::OverlayElement, getWidth), asCALL_THISCALL);
1807  engine->RegisterObjectMethod("OverlayElement", "float getHeight() const", asMETHOD(Ogre::OverlayElement, getHeight), asCALL_THISCALL);
1808  engine->RegisterObjectMethod("OverlayElement", "void setLeft(float)", asMETHOD(Ogre::OverlayElement, setLeft), asCALL_THISCALL);
1809  engine->RegisterObjectMethod("OverlayElement", "void setTop(float)", asMETHOD(Ogre::OverlayElement, setTop), asCALL_THISCALL);
1810  engine->RegisterObjectMethod("OverlayElement", "void setWidth(float)", asMETHOD(Ogre::OverlayElement, setWidth), asCALL_THISCALL);
1811  engine->RegisterObjectMethod("OverlayElement", "void setHeight(float)", asMETHOD(Ogre::OverlayElement, setHeight), asCALL_THISCALL);
1812  // > material
1813  engine->RegisterObjectMethod("OverlayElement", "const string& getMaterialName() const", asMETHOD(Ogre::OverlayElement, getMaterialName), asCALL_THISCALL);
1814  engine->RegisterObjectMethod("OverlayElement", "void setMaterialName(const string&in, const string&in)", asMETHOD(Ogre::OverlayElement, setMaterialName), asCALL_THISCALL);
1815  // > caption
1816  engine->RegisterObjectMethod("OverlayElement", "void setCaption(const string&in)", asMETHOD(Ogre::OverlayElement, setCaption), asCALL_THISCALL);
1817  engine->RegisterObjectMethod("OverlayElement", "const string& getCaption() const", asMETHOD(Ogre::OverlayElement, getCaption), asCALL_THISCALL);
1818  // > color
1819  engine->RegisterObjectMethod("OverlayElement", "void setColour(const color&in)", asMETHOD(Ogre::OverlayElement, setColour), asCALL_THISCALL);
1820  engine->RegisterObjectMethod("OverlayElement", "const color& getColour() const", asMETHOD(Ogre::OverlayElement, getColour), asCALL_THISCALL);
1821  // > GuiMetricsMode
1822  engine->RegisterObjectMethod("OverlayElement", "GuiMetricsMode getMetricsMode() const", asMETHOD(Ogre::OverlayElement, getMetricsMode), asCALL_THISCALL);
1823  engine->RegisterObjectMethod("OverlayElement", "void setMetricsMode(GuiMetricsMode)", asMETHOD(Ogre::OverlayElement, setMetricsMode), asCALL_THISCALL);
1824  // > GuiHorizontalAlignment
1825  engine->RegisterObjectMethod("OverlayElement", "GuiHorizontalAlignment getHorizontalAlignment() const", asMETHOD(Ogre::OverlayElement, getHorizontalAlignment), asCALL_THISCALL);
1826  engine->RegisterObjectMethod("OverlayElement", "void setHorizontalAlignment(GuiHorizontalAlignment)", asMETHOD(Ogre::OverlayElement, setHorizontalAlignment), asCALL_THISCALL);
1827 
1828 
1829  // Register the Overlay class
1830  // (order roughly matches OgreOverlay.h)
1831  engine->RegisterObjectType("Overlay", 0, asOBJ_REF | asOBJ_NOCOUNT);
1832  engine->RegisterObjectMethod("Overlay", "const string& getName() const", asMETHOD(Ogre::Overlay, getName), asCALL_THISCALL);
1833  // > z-order
1834  engine->RegisterObjectMethod("Overlay", "void setZOrder(uint16)", asMETHOD(Ogre::Overlay, setZOrder), asCALL_THISCALL);
1835  engine->RegisterObjectMethod("Overlay", "uint16 getZOrder()", asMETHOD(Ogre::Overlay, getZOrder), asCALL_THISCALL);
1836  // > visibility
1837  engine->RegisterObjectMethod("Overlay", "bool isVisible() const", asMETHODPR(Ogre::Overlay, isVisible, () const, bool), asCALL_THISCALL);
1838  engine->RegisterObjectMethod("Overlay", "void show()", asMETHODPR(Ogre::Overlay, show, (), void), asCALL_THISCALL);
1839  engine->RegisterObjectMethod("Overlay", "void hide()", asMETHODPR(Ogre::Overlay, hide, (), void), asCALL_THISCALL);
1840  // > 2D elements
1841  engine->RegisterObjectMethod("Overlay", "void add2D(OverlayElement@)", asFUNCTIONPR([](Ogre::Overlay* self, Ogre::OverlayElement* elem) {
1842  try { self->add2D(dynamic_cast<Ogre::OverlayContainer*>(elem)); }
1843  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Overlay::add2D()"); } }, (Ogre::Overlay* , Ogre::OverlayElement* ), void), asCALL_CDECL_OBJFIRST);
1844  engine->RegisterObjectMethod("Overlay", "void remove2D(OverlayElement@)", asFUNCTIONPR([](Ogre::Overlay* self, Ogre::OverlayElement* elem) {
1845  try { self->remove2D(dynamic_cast<Ogre::OverlayContainer*>(elem)); }
1846  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Overlay::remove2D()"); } }, (Ogre::Overlay* , Ogre::OverlayElement* ), void), asCALL_CDECL_OBJFIRST);
1847  // > scrolling
1848  engine->RegisterObjectMethod("Overlay", "void setScroll(float, float)", asMETHOD(Ogre::Overlay, setScroll), asCALL_THISCALL);
1849  engine->RegisterObjectMethod("Overlay", "float getScrollX() const", asMETHOD(Ogre::Overlay, getScrollX), asCALL_THISCALL);
1850  engine->RegisterObjectMethod("Overlay", "float getScrollY() const", asMETHOD(Ogre::Overlay, getScrollY), asCALL_THISCALL);
1851  engine->RegisterObjectMethod("Overlay", "void scroll(float, float)", asMETHOD(Ogre::Overlay, scroll), asCALL_THISCALL);
1852  // > rotating
1853  engine->RegisterObjectMethod("Overlay", "void setRotate(const radian&in)", asMETHOD(Ogre::Overlay, setRotate), asCALL_THISCALL);
1854  engine->RegisterObjectMethod("Overlay", "const radian& getRotate() const", asMETHOD(Ogre::Overlay, getRotate), asCALL_THISCALL);
1855  engine->RegisterObjectMethod("Overlay", "void rotate(const radian&in)", asMETHOD(Ogre::Overlay, rotate), asCALL_THISCALL);
1856  // > scaling
1857  engine->RegisterObjectMethod("Overlay", "void setScale(float, float)", asMETHOD(Ogre::Overlay, setScale), asCALL_THISCALL);
1858  engine->RegisterObjectMethod("Overlay", "float getScaleX() const", asMETHOD(Ogre::Overlay, getScaleX), asCALL_THISCALL);
1859  engine->RegisterObjectMethod("Overlay", "float getScaleY() const", asMETHOD(Ogre::Overlay, getScaleY), asCALL_THISCALL);
1860  // > 2D elements
1861  engine->RegisterObjectMethod("Overlay", "array<OverlayElement@>@ get2DElements()", asFUNCTION(get2DElementsHelper), asCALL_CDECL_OBJFIRST);
1862 
1863 
1864  // Register the OverlayManager class
1865  // (order roughly matches OgreOverlayManager.h)
1866  engine->RegisterObjectType("OverlayManager", 0, asOBJ_REF | asOBJ_NOCOUNT);
1867  // > overlay management
1868  engine->RegisterObjectMethod("OverlayManager", "Overlay@ create(const string&in)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name) {
1869  try {return self->create(name);}
1870  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::create()"); return (Ogre::Overlay*)nullptr;}}, (Ogre::OverlayManager*, const std::string&), Ogre::Overlay*), asCALL_CDECL_OBJFIRST);
1871  engine->RegisterObjectMethod("OverlayManager", "Overlay@ getByName(const string&in)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name) {
1872  try {return self->getByName(name);} // Doesn't seem to throw, but just to be sure...
1873  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::getByName()"); return (Ogre::Overlay*)nullptr;}}, (Ogre::OverlayManager*, const std::string&), Ogre::Overlay*), asCALL_CDECL_OBJFIRST);
1874  engine->RegisterObjectMethod("OverlayManager", "void destroy(const string&in)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name) {
1875  try {return self->destroy(name);}
1876  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroy(string)"); }}, (Ogre::OverlayManager*, const std::string&), void), asCALL_CDECL_OBJFIRST);
1877  engine->RegisterObjectMethod("OverlayManager", "void destroy(Overlay@)", asFUNCTIONPR([](Ogre::OverlayManager* self, Ogre::Overlay* ov) {
1878  try {return self->destroy(ov);}
1879  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroy(Overlay@)"); }}, (Ogre::OverlayManager*, Ogre::Overlay*), void), asCALL_CDECL_OBJFIRST);
1880  engine->RegisterObjectMethod("OverlayManager", "void destroyAll()", asFUNCTIONPR([](Ogre::OverlayManager* self) {
1881  try {return self->destroyAll();}
1882  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroyAll()"); }}, (Ogre::OverlayManager*), void), asCALL_CDECL_OBJFIRST);
1883  // NOTE: we have `getOverlays()` instead of `getOverlayIterator()`
1884  engine->RegisterObjectMethod("OverlayManager", "array<Overlay@>@ getOverlays()", asFUNCTIONPR([](Ogre::OverlayManager* self) {
1885  try {auto iterable = self->getOverlayIterator();
1886  return IterableMapToScriptArray(iterable.begin(), iterable.end(), "Ogre::Overlay@"); }
1887  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::getOverlays()"); return (CScriptArray*)nullptr; } }, (Ogre::OverlayManager*), CScriptArray*), asCALL_CDECL_OBJFIRST);
1888  // > viewport info
1889  engine->RegisterObjectMethod("OverlayManager", "float getViewportHeight() const", asMETHOD(Ogre::OverlayManager, getViewportHeight), asCALL_THISCALL);
1890  engine->RegisterObjectMethod("OverlayManager", "float getViewportWidth() const", asMETHOD(Ogre::OverlayManager, getViewportWidth), asCALL_THISCALL);
1891  // > overlay element management
1892  engine->RegisterObjectMethod("OverlayManager", "OverlayElement@ createOverlayElement(const string&in, const string&in, bool=false)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& type, const std::string& name, bool isTemplate) {
1893  try {return dynamic_cast<Ogre::OverlayElement*>(self->createOverlayElement(type,name,isTemplate));}
1894  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::createOverlayElement()"); return (Ogre::OverlayElement*)nullptr;}}, (Ogre::OverlayManager*, const std::string&, const std::string&, bool), Ogre::OverlayElement*), asCALL_CDECL_OBJFIRST);
1895  engine->RegisterObjectMethod("OverlayManager", "OverlayElement@ getOverlayElement(const string&in) const", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name) {
1896  try {return dynamic_cast<Ogre::OverlayElement*>(self->getOverlayElement(name));}
1897  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::getOverlayElement()"); return (Ogre::OverlayElement*)nullptr;}}, (Ogre::OverlayManager*, const std::string&), Ogre::OverlayElement*), asCALL_CDECL_OBJFIRST);
1898  engine->RegisterObjectMethod("OverlayManager", "bool hasOverlayElement(const string&in) const", asMETHOD(Ogre::OverlayManager, hasOverlayElement), asCALL_THISCALL);
1899  engine->RegisterObjectMethod("OverlayManager", "void destroyOverlayElement(const string&in, bool isTemplate=false) const", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name, bool isTemplate) {
1900  try { self->destroyOverlayElement(name, isTemplate);}
1901  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroyOverlayElement(string)"); }}, (Ogre::OverlayManager*, const std::string&, bool), void), asCALL_CDECL_OBJFIRST);
1902  engine->RegisterObjectMethod("OverlayManager", "void destroyOverlayElement(OverlayElement@, bool isTemplate=false) const", asFUNCTIONPR([](Ogre::OverlayManager* self, Ogre::OverlayElement* oe, bool isTemplate) {
1903  try { self->destroyOverlayElement(oe, isTemplate);}
1904  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroyOverlayElement(OverlayElement@)"); }}, (Ogre::OverlayManager*, Ogre::OverlayElement*, bool), void), asCALL_CDECL_OBJFIRST);
1905  engine->RegisterObjectMethod("OverlayManager", "void destroyAllOverlayElements(bool isTemplate=false) const", asFUNCTIONPR([](Ogre::OverlayManager* self, bool isTemplate) {
1906  try { self->destroyAllOverlayElements(isTemplate);}
1907  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::destroyAllOverlayElements()"); }}, (Ogre::OverlayManager*, bool), void), asCALL_CDECL_OBJFIRST);
1908  // > template management
1909  engine->RegisterObjectMethod("OverlayManager", "OverlayElement@ createOverlayElementFromTemplate(const string&in, const string&in, const string&in, bool=false)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& templateName, const std::string& typeName, const std::string& instanceName, bool isTemplate) {
1910  try {return dynamic_cast<Ogre::OverlayElement*>(self->createOverlayElementFromTemplate(templateName, typeName, instanceName, isTemplate));}
1911  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::createOverlayElementFromTemplate()"); return (Ogre::OverlayElement*)nullptr;}}, (Ogre::OverlayManager*, const std::string&, const std::string&, const std::string&, bool), Ogre::OverlayElement*), asCALL_CDECL_OBJFIRST);
1912  engine->RegisterObjectMethod("OverlayManager", "OverlayElement@ cloneOverlayElementFromTemplate(const string&in, const string&in)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& templateName, const std::string& instanceName) {
1913  try {return dynamic_cast<Ogre::OverlayElement*>(self->cloneOverlayElementFromTemplate(templateName, instanceName));}
1914  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::cloneOverlayElementFromTemplate()"); return (Ogre::OverlayElement*)nullptr;}}, (Ogre::OverlayManager*, const std::string&, const std::string&), Ogre::OverlayElement*), asCALL_CDECL_OBJFIRST);
1915  // NOTE: we have `getTemplates()` instead of `getTemplateIterator()`
1916  engine->RegisterObjectMethod("OverlayManager", "array<OverlayElement@>@ getTemplates()", asFUNCTION(getElementTemplatesHelper), asCALL_CDECL_OBJFIRST);
1917  engine->RegisterObjectMethod("OverlayManager", "bool isTemplate(const string&in)", asFUNCTIONPR([](Ogre::OverlayManager* self, const std::string& name) {
1918  try {return self->isTemplate(name);}
1919  catch(...) {App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::OverlayManager::isTemplate()"); return false;}}, (Ogre::OverlayManager*, const std::string&), bool), asCALL_CDECL_OBJFIRST);
1920 
1921 
1922  engine->SetDefaultNamespace("Ogre::OverlayManager");
1923  engine->RegisterGlobalFunction("OverlayManager& getSingleton()", asFUNCTION(OverlayManager::getSingleton), asCALL_CDECL);
1924 
1925  engine->SetDefaultNamespace("");
1926 
1927 }
1928 
1929 void registerOgreManualObject(AngelScript::asIScriptEngine* engine)
1930 {
1931  engine->SetDefaultNamespace("Ogre");
1932 
1933  // Register the ManualObject class
1934  engine->RegisterObjectType("ManualObject", 0, asOBJ_REF | asOBJ_NOCOUNT);
1935  engine->RegisterObjectMethod("ManualObject", "void begin(const string&in, RenderOperation, const string&in)", asMETHODPR(Ogre::ManualObject, begin, (const String&, Ogre::RenderOperation::OperationType, const String&), void), asCALL_THISCALL);
1936  engine->RegisterObjectMethod("ManualObject", "void beginUpdate()", asMETHOD(Ogre::ManualObject, beginUpdate), asCALL_THISCALL);
1937  engine->RegisterObjectMethod("ManualObject", "void position(const vector3&in)", asMETHODPR(Ogre::ManualObject, position, (const Ogre::Vector3&), void), asCALL_THISCALL);
1938  engine->RegisterObjectMethod("ManualObject", "void normal(const vector3&in)", asMETHODPR(Ogre::ManualObject, normal, (const Ogre::Vector3&), void), asCALL_THISCALL);
1939  engine->RegisterObjectMethod("ManualObject", "void textureCoord(float, float)", asMETHODPR(Ogre::ManualObject, textureCoord, (float, float), void), asCALL_THISCALL);
1940  engine->RegisterObjectMethod("ManualObject", "void textureCoord(const vector2&in)", asMETHODPR(Ogre::ManualObject, textureCoord, (const Ogre::Vector2&), void), asCALL_THISCALL);
1941  engine->RegisterObjectMethod("ManualObject", "void textureCoord(const vector3&in)", asMETHODPR(Ogre::ManualObject, textureCoord, (const Ogre::Vector3&), void), asCALL_THISCALL);
1942  engine->RegisterObjectMethod("ManualObject", "void colour(const color&in)", asMETHODPR(Ogre::ManualObject, colour, (const Ogre::ColourValue&), void), asCALL_THISCALL);
1943  engine->RegisterObjectMethod("ManualObject", "void index(uint32)", asMETHOD(Ogre::ManualObject, index), asCALL_THISCALL);
1944  engine->RegisterObjectMethod("ManualObject", "void end()", asMETHOD(Ogre::ManualObject, end), asCALL_THISCALL);
1945 
1946  engine->RegisterObjectMethod("ManualObject", "uint getCurrentVertexCount()", asMETHOD(Ogre::ManualObject, getCurrentVertexCount), asCALL_THISCALL);
1947  engine->RegisterObjectMethod("ManualObject", "void getCurrentIndexCount()", asMETHOD(Ogre::ManualObject, getCurrentIndexCount), asCALL_THISCALL);
1948 
1949  engine->RegisterObjectMethod("ManualObject", "MeshPtr convertToMesh(const string&in name, const string&in group = 'General')", asMETHOD(Ogre::ManualObject, convertToMesh), asCALL_THISCALL);
1950 
1951  engine->SetDefaultNamespace("");
1952 }
1953 
1954 static PixelBox PIXELBOX_DUMMY = PixelBox(); // for returning as `const&`
1955 
1956 void registerOgreHardwarePixelBuffer(AngelScript::asIScriptEngine* engine)
1957 {
1958  int r;
1959  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
1960 
1961  r = engine->RegisterObjectBehaviour("HardwarePixelBufferPtr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(HardwarePixelBufferPtrDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1962  r = engine->RegisterObjectBehaviour("HardwarePixelBufferPtr", asBEHAVE_CONSTRUCT, "void f(const HardwarePixelBufferPtr&in)", asFUNCTION(HardwarePixelBufferPtrCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1963  r = engine->RegisterObjectBehaviour("HardwarePixelBufferPtr", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(HardwarePixelBufferPtrDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1964  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "HardwarePixelBufferPtr& opAssign(const HardwarePixelBufferPtr&in)", asFUNCTION(HardwarePixelBufferPtrAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
1965 
1966  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "const PixelBox& getCurrentLock()", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self) -> const PixelBox& {
1967  try { return self->getCurrentLock(); }
1968  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::getCurrentLock()"); return PIXELBOX_DUMMY;}
1969  }, (HardwarePixelBufferSharedPtr const&), const PixelBox&), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1970 
1971  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "const PixelBox& lock(const box& lockbox, HardwareBufferLockOptions opt)", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self, const Box& lockbox, HardwareBuffer::LockOptions opt) -> const PixelBox& {
1972  try { return self->lock(lockbox, opt); }
1973  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::lock()"); return PIXELBOX_DUMMY;}
1974  }, (HardwarePixelBufferSharedPtr const&, const Box&, HardwareBuffer::LockOptions), const PixelBox&), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1975 
1976  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "uint getWidth()", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self) -> asUINT {
1977  try { return self->getWidth(); }
1978  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::getWidth()"); return 0;}
1979  }, (HardwarePixelBufferSharedPtr const&), asUINT), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1980 
1981  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "uint getHeight()", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self) -> asUINT {
1982  try { return self->getHeight(); }
1983  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::getHeight()"); return 0;}
1984  }, (HardwarePixelBufferSharedPtr const&), asUINT), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1985 
1986  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "void blitFromMemory(const PixelBox& src, const box& dst)", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self, const PixelBox& src, const Box& dstBox){
1987  try { self->blitFromMemory(src, dstBox); }
1988  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::blitFromMemory()"); }
1989  }, (HardwarePixelBufferSharedPtr const&, const PixelBox&, const Box&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1990 
1991  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "void blitToMemory(const box& src, const PixelBox& dst)", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self, const Box& srcBox, const PixelBox& dst){
1992  try { self->blitToMemory(srcBox, dst); }
1993  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::blitToMemory()"); }
1994  }, (HardwarePixelBufferSharedPtr const&, const Box&, const PixelBox&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
1995 
1996  r = engine->RegisterObjectMethod("HardwarePixelBufferPtr", "void unlock()", asFUNCTIONPR([](HardwarePixelBufferSharedPtr const& self){
1997  try { self->unlock(); }
1998  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::HardwarePixelBuffer::unlock()"); }
1999  }, (HardwarePixelBufferSharedPtr const&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2000 
2001  engine->SetDefaultNamespace("");
2002 }
2003 
2004 void registerOgrePixelBox(AngelScript::asIScriptEngine* engine)
2005 {
2006  int r;
2007  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2008 
2009  r = engine->RegisterObjectBehaviour("PixelBox", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(PixelBoxDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2010  r = engine->RegisterObjectBehaviour("PixelBox", asBEHAVE_CONSTRUCT, "void f(const PixelBox&in)", asFUNCTION(PixelBoxCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2011  r = engine->RegisterObjectBehaviour("PixelBox", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(PixelBoxDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2012  r = engine->RegisterObjectMethod("PixelBox", "PixelBox& opAssign(const PixelBox&in)", asFUNCTION(PixelBoxAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2013 
2014  r = engine->RegisterObjectMethod("PixelBox", "color getColourAt(uint32 x, uint32 y, uint32 z)", asMETHOD(PixelBox, getColourAt), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2015  r = engine->RegisterObjectMethod("PixelBox", "void setColourAt(const color& c, uint32 x, uint32 y, uint32 z)", asMETHOD(PixelBox, setColourAt), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2016 
2017  // Inherited methods must have wrappers - see AngelScript doc
2018  r = engine->RegisterObjectMethod("PixelBox", "uint getWidth()", asFUNCTIONPR([](const Ogre::PixelBox& self) -> asUINT {
2019  return self.getWidth();
2020  }, (const Ogre::PixelBox&), asUINT), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2021 
2022  r = engine->RegisterObjectMethod("PixelBox", "uint getHeight()", asFUNCTIONPR([](const Ogre::PixelBox& self) -> asUINT {
2023  return self.getHeight();
2024  }, (const Ogre::PixelBox&), asUINT), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2025 
2026  r = engine->RegisterObjectMethod("PixelBox", "uint getDepth()", asFUNCTIONPR([](const Ogre::PixelBox& self) -> asUINT {
2027  return self.getDepth();
2028  } , (const Ogre::PixelBox&), asUINT), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2029 
2030  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2031 }
2032 
2033 void registerOgreImage(AngelScript::asIScriptEngine* engine)
2034 {
2035  int r;
2036  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2037 
2038  r = engine->RegisterObjectBehaviour("Image", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ImageDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2039  r = engine->RegisterObjectBehaviour("Image", asBEHAVE_CONSTRUCT, "void f(const Image&in)", asFUNCTION(ImageCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2040  r = engine->RegisterObjectBehaviour("Image", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(ImageDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2041  r = engine->RegisterObjectMethod("Image", "Image& opAssign(const Image&in)", asFUNCTION(ImageAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2042 
2043  r = engine->RegisterObjectMethod("Image", "color getColourAt(uint32 x, uint32 y, uint32 z)", asMETHOD(Image, getColourAt), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2044  r = engine->RegisterObjectMethod("Image", "void setColourAt(const color& c, uint32 x, uint32 y, uint32 z)", asMETHOD(Image, setColourAt), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2045  r = engine->RegisterObjectMethod("Image", "Image& flipAroundX()", asMETHOD(Ogre::Image, flipAroundX), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2046  r = engine->RegisterObjectMethod("Image", "Image& flipAroundY()", asMETHOD(Ogre::Image, flipAroundY), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2047  r = engine->RegisterObjectMethod("Image", "uint getNumMipmaps()", asMETHOD(Ogre::Image, getNumMipmaps), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2048  r = engine->RegisterObjectMethod("Image", "uint getNumFaces()", asMETHOD(Ogre::Image, getNumFaces), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2049  r = engine->RegisterObjectMethod("Image", "PixelBox getPixelBox(uint face, uint mipmap)", asMETHOD(Ogre::Image, getPixelBox), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2050  r = engine->RegisterObjectMethod("Image", "uint getSize()", asMETHOD(Ogre::Image, getSize), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2051  r = engine->RegisterObjectMethod("Image", "uint getWidth()", asMETHOD(Ogre::Image, getWidth), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2052  r = engine->RegisterObjectMethod("Image", "uint getHeight()", asMETHOD(Ogre::Image, getHeight), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2053  r = engine->RegisterObjectMethod("Image", "void resize(uint16 width, uint16 height, ImageFilter filter)", asMETHOD(Ogre::Image, resize), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2054 
2055  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2056 }
2057 
2058 void registerOgreSubMesh(AngelScript::asIScriptEngine* engine)
2059 {
2060  engine->SetDefaultNamespace("Ogre");
2061 
2062  // Register the SubMesh class
2063  engine->RegisterObjectMethod("SubMesh", "const string& getMaterialName()", asMETHOD(Ogre::SubMesh, getMaterialName), asCALL_THISCALL);
2064  engine->RegisterObjectMethod("SubMesh", "void setMaterialName(const string&in, const string&in)", asMETHOD(Ogre::SubMesh, setMaterialName), asCALL_THISCALL);
2065 
2066  // > Vertex buffer
2067  engine->RegisterObjectMethod("SubMesh", "array<vector3>@ __getVertexPositions()", asFUNCTION(SubMesh__getVertexPositions), asCALL_CDECL_OBJFIRST);
2068  engine->RegisterObjectMethod("SubMesh", "array<vector2>@ __getVertexTexcoords(uint index)", asFUNCTION(SubMesh__getVertexTexcoords), asCALL_CDECL_OBJFIRST);
2069 
2070  // > Index buffer
2071  engine->RegisterObjectMethod("SubMesh", "array<uint16>@ __getIndexBuffer16bit()", asFUNCTIONPR([](Ogre::SubMesh* self) {
2072  const Ogre::HardwareIndexBuffer::IndexType desiredType = Ogre::HardwareIndexBuffer::IndexType::IT_16BIT;
2073  if (SubMesh__getIndexType(self) == desiredType) { return SubMesh__getIndexBufferHelper(self, desiredType); }
2074  else { App::GetScriptEngine()->SLOG("SubMesh::__getIndexBuffer16bit(): The buffer format isn't 16bit."); return (CScriptArray*)nullptr; }
2075  }, (Ogre::SubMesh*), CScriptArray*), asCALL_CDECL_OBJFIRST);
2076  engine->RegisterObjectMethod("SubMesh", "array<uint>@ __getIndexBuffer32bit()", asFUNCTIONPR([](Ogre::SubMesh* self) {
2077  const Ogre::HardwareIndexBuffer::IndexType desiredType = Ogre::HardwareIndexBuffer::IndexType::IT_32BIT;
2078  if (SubMesh__getIndexType(self) == desiredType) { return SubMesh__getIndexBufferHelper(self, desiredType); }
2079  else { App::GetScriptEngine()->SLOG("SubMesh::__getIndexBuffer32bit(): The buffer format isn't 32bit."); return (CScriptArray*)nullptr; }
2080  }, (Ogre::SubMesh*), CScriptArray*), asCALL_CDECL_OBJFIRST);
2081  engine->RegisterObjectMethod("SubMesh", "IndexType __getIndexType()", asFUNCTION(SubMesh__getIndexType), asCALL_CDECL_OBJFIRST);
2082 
2083  engine->SetDefaultNamespace("");
2084 }
2085 
2086 void registerOgreMesh(AngelScript::asIScriptEngine* engine)
2087 {
2088  int r;
2089  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2090 
2091  r = engine->RegisterObjectBehaviour("MeshPtr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(MeshPtrDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2092  r = engine->RegisterObjectBehaviour("MeshPtr", asBEHAVE_CONSTRUCT, "void f(const MeshPtr&in)", asFUNCTION(MeshPtrCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2093  r = engine->RegisterObjectBehaviour("MeshPtr", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(MeshPtrDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2094  r = engine->RegisterObjectMethod("MeshPtr", "MeshPtr& opAssign(const MeshPtr&in)", asFUNCTION(MeshPtrAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2095  r = engine->RegisterObjectMethod("MeshPtr", "bool isNull()", asFUNCTION(MeshPtrIsNull), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2096 
2097  // Wrappers are inevitable, see https://www.gamedev.net/forums/topic/540419-custom-smartpointers-and-angelscript-/
2098  r = engine->RegisterObjectMethod("MeshPtr", "SubMeshArray@ getSubMeshes()", asFUNCTION(MeshPtrGetSubmeshes), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2099  r = engine->RegisterObjectMethod("MeshPtr", "string getName()", asFUNCTIONPR([](MeshPtr const& self) {
2100  return self->getName();
2101  }, (MeshPtr const&), Ogre::String), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2102  r = engine->RegisterObjectMethod("MeshPtr", "SubMesh@ createSubMesh(const string&in name)", asFUNCTIONPR([](MeshPtr const& self, const Ogre::String& name) {
2103  return self->createSubMesh(name);
2104  }, (MeshPtr const&, const Ogre::String&), Ogre::SubMesh*), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2105  r = engine->RegisterObjectMethod("MeshPtr", "void destroySubMesh(const string&in name)", asFUNCTIONPR([](MeshPtr const& self, const Ogre::String& name) {
2106  self->createSubMesh(name);
2107  }, (MeshPtr const&, const Ogre::String&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2108 
2109  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2110 }
2111 
2112 void registerOgreMeshManager(AngelScript::asIScriptEngine * engine)
2113 {
2114  int r;
2115  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2116 
2117  r = engine->RegisterObjectMethod("MeshManager", "MeshPtr load(const string&in file, const string&in rg)", asFUNCTIONPR([](MeshManager& mgr, std::string const& file, std::string const& rg){
2118  try { return mgr.load(file, rg); }
2119  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::MeshManager::load()"); return Ogre::MeshPtr();}
2120  }, (MeshManager& mgr, std::string const& file, std::string const& rg), MeshPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2121 
2122  r = engine->RegisterObjectMethod("MeshManager", "void remove(const string&in file, const string&in rg)", asFUNCTIONPR([](MeshManager& mgr, std::string const& file, std::string const& rg){
2123  try { mgr.remove(file, rg); }
2124  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::MeshManager::remove()"); }
2125  }, (MeshManager& mgr, std::string const& file, std::string const& rg), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2126 
2127  r = engine->SetDefaultNamespace("Ogre::MeshManager"); ROR_ASSERT(r >= 0);
2128  r = engine->RegisterGlobalFunction("MeshManager& getSingleton()", asFUNCTION(MeshManager::getSingleton), asCALL_CDECL); ROR_ASSERT(r >= 0);
2129 
2130  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2131 }
2132 
2133 void registerOgreMaterialManager(AngelScript::asIScriptEngine * engine)
2134 {
2135  int r;
2136  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2137 
2138  r = engine->RegisterObjectMethod("MaterialManager", "MaterialPtr getByName(const string&in file, const string&in rg)", asFUNCTIONPR([](MaterialManager& mgr, std::string const& file, std::string const& rg){
2139  try { return mgr.getByName(file, rg); }
2140  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::MaterialManager::getByName()"); return Ogre::MaterialPtr();}
2141  }, (MaterialManager& mgr, std::string const& file, std::string const& rg), MaterialPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2142 
2143  r = engine->RegisterObjectMethod("MaterialManager", "void create(const string&in file, const string&in rg)", asFUNCTIONPR([](MaterialManager& mgr, std::string const& file, std::string const& rg){
2144  try { return mgr.create(file, rg); }
2145  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::MaterialManager::create()"); return Ogre::MaterialPtr(); }
2146  }, (MaterialManager& mgr, std::string const& file, std::string const& rg), MaterialPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2147 
2148  r = engine->SetDefaultNamespace("Ogre::MaterialManager"); ROR_ASSERT(r >= 0);
2149  r = engine->RegisterGlobalFunction("MaterialManager& getSingleton()", asFUNCTION(MaterialManager::getSingleton), asCALL_CDECL); ROR_ASSERT(r >= 0);
2150 
2151  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2152 }
2153 
2154 void registerOgreMaterial(AngelScript::asIScriptEngine* engine)
2155 {
2156  int r;
2157  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2158 
2159  r = engine->RegisterObjectBehaviour("MaterialPtr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(MaterialPtrDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2160  r = engine->RegisterObjectBehaviour("MaterialPtr", asBEHAVE_CONSTRUCT, "void f(const MaterialPtr&in)", asFUNCTION(MaterialPtrCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2161  r = engine->RegisterObjectBehaviour("MaterialPtr", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(MaterialPtrDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2162  r = engine->RegisterObjectMethod("MaterialPtr", "MaterialPtr& opAssign(const MaterialPtr&in)", asFUNCTION(MaterialPtrAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2163  r = engine->RegisterObjectMethod("MaterialPtr", "bool isNull()", asFUNCTION(MaterialPtrIsNull), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2164 
2165  // Wrappers are inevitable, see https://www.gamedev.net/forums/topic/540419-custom-smartpointers-and-angelscript-/
2166  r = engine->RegisterObjectMethod("MaterialPtr", "TechniqueArray@ getTechniques()", asFUNCTION(MaterialPtrGetTechniques), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2167 
2168  r = engine->RegisterObjectMethod("MaterialPtr", "string getName()", asFUNCTIONPR([](MaterialPtr const& self) {
2169  return self->getName();
2170  }, (MaterialPtr const&), Ogre::String), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2171 
2172  r = engine->RegisterObjectMethod("MaterialPtr", "Technique@ createTechnique()", asFUNCTIONPR([](MaterialPtr const& self) {
2173  try { return self->createTechnique(); }
2174  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Material::createTechnique()"); return (Ogre::Technique*)nullptr;}
2175  }, (MaterialPtr const&), Ogre::Technique*), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2176 
2177  r = engine->RegisterObjectMethod("MaterialPtr", "void removeTechnique()", asFUNCTIONPR([](MaterialPtr const& self, uint16_t index) {
2178  try { self->removeTechnique(index); }
2179  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Material::removeTechnique()"); }
2180  }, (MaterialPtr const&, uint16_t), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2181 
2182  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2183 }
2184 
2185 void registerOgreTechnique(AngelScript::asIScriptEngine* engine)
2186 {
2187  engine->SetDefaultNamespace("Ogre");
2188 
2189  engine->RegisterObjectMethod("Technique", "PassArray @getPasses()", asFUNCTION(TechniqueGetPasses), asCALL_CDECL_OBJFIRST);
2190  engine->RegisterObjectMethod("Technique", "Pass @createPass()", asMETHOD(Ogre::Technique, createPass), asCALL_THISCALL);
2191  engine->RegisterObjectMethod("Technique", "void removePass(uint16 index)", asMETHOD(Ogre::Technique, removePass), asCALL_THISCALL);
2192  engine->RegisterObjectMethod("Technique", "const string& getName() const", asMETHOD(Ogre::Technique, getName), asCALL_THISCALL);
2193 
2194  engine->SetDefaultNamespace("");
2195 }
2196 
2197 void registerOgrePass(AngelScript::asIScriptEngine* engine)
2198 {
2199  int r = 0;
2200  engine->SetDefaultNamespace("Ogre");
2201 
2202  engine->RegisterObjectMethod("Pass", "const string& getName() const", asMETHOD(Ogre::Pass, getName), asCALL_THISCALL);
2203  engine->RegisterObjectMethod("Pass", "TextureUnitStateArray @getTextureUnitStates()", asFUNCTION(PassGetTextureUnitStates), asCALL_CDECL_OBJFIRST);
2204  engine->RegisterObjectMethod("Pass", "void removeTextureUnitState(uint16 index)", asMETHOD(Ogre::Pass, removeTextureUnitState), asCALL_THISCALL);
2205 
2206  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getVertexProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2207  try { return self->getVertexProgramParameters(); }
2208  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getVertexProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2209  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2210 
2211  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getFragmentProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2212  try { return self->getFragmentProgramParameters(); }
2213  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getFragmentProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2214  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2215 
2216  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getGeometryProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2217  try { return self->getGeometryProgramParameters(); }
2218  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getGeometryProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2219  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2220 
2221  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getTessellationHullProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2222  try { return self->getTessellationHullProgramParameters(); }
2223  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getTessellationHullProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2224  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2225 
2226  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getTessellationDomainProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2227  try { return self->getTessellationDomainProgramParameters(); }
2228  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getTessellationDomainProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2229  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2230 
2231  r = engine->RegisterObjectMethod("Pass", "GpuProgramParametersPtr getComputeProgramParameters()", asFUNCTIONPR([](Ogre::Pass* self) -> Ogre::GpuProgramParametersPtr {
2232  try { return self->getComputeProgramParameters(); }
2233  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::Pass::getComputeProgramParameters()"); return Ogre::GpuProgramParametersPtr(); }
2234  }, (Ogre::Pass*), Ogre::GpuProgramParametersPtr), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2235 
2236  engine->RegisterObjectMethod("Pass", "void setVertexProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setVertexProgramParameters), asCALL_THISCALL);
2237  engine->RegisterObjectMethod("Pass", "void setFragmentProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setFragmentProgramParameters), asCALL_THISCALL);
2238  engine->RegisterObjectMethod("Pass", "void setGeometryProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setGeometryProgramParameters), asCALL_THISCALL);
2239  engine->RegisterObjectMethod("Pass", "void setTessellationHullProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setTessellationHullProgramParameters), asCALL_THISCALL);
2240  engine->RegisterObjectMethod("Pass", "void setTessellationDomainProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setTessellationDomainProgramParameters), asCALL_THISCALL);
2241  engine->RegisterObjectMethod("Pass", "void setComputeProgramParameters(GpuProgramParametersPtr)", asMETHOD(Ogre::Pass, setComputeProgramParameters), asCALL_THISCALL);
2242 
2243  engine->SetDefaultNamespace("");
2244 }
2245 
2246 void registerOgreTextureUnitState(AngelScript::asIScriptEngine* engine)
2247 {
2248  engine->SetDefaultNamespace("Ogre");
2249 
2250  engine->RegisterObjectMethod("TextureUnitState", "const string& getName() const", asMETHOD(Ogre::TextureUnitState, getName), asCALL_THISCALL);
2251  engine->RegisterObjectMethod("TextureUnitState", "void setTexture(const TexturePtr&in)", asMETHODPR(Ogre::TextureUnitState, setTexture, (const TexturePtr&), void), asCALL_THISCALL);
2252  engine->RegisterObjectMethod("TextureUnitState", "const TexturePtr& _getTexturePtr() const", asMETHODPR(Ogre::TextureUnitState, _getTexturePtr, (void) const, const TexturePtr&), asCALL_THISCALL);
2253 
2254  engine->SetDefaultNamespace("");
2255 }
2256 
2257 void registerOgreTimer(AngelScript::asIScriptEngine* engine)
2258 {
2259  int r;
2260  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2261 
2262  r = engine->RegisterObjectBehaviour("Timer", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(TimerDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2263  r = engine->RegisterObjectBehaviour("Timer", asBEHAVE_CONSTRUCT, "void f(const Timer&in)", asFUNCTION(TimerCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2264  r = engine->RegisterObjectBehaviour("Timer", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(TimerDefaultDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2265  r = engine->RegisterObjectMethod("Timer", "Timer& opAssign(const Timer&in)", asFUNCTION(TimerAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2266 
2267  r = engine->RegisterObjectMethod("Timer", "void reset()", asMETHOD(Timer, reset), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2268  r = engine->RegisterObjectMethod("Timer", "uint getMilliseconds()", asMETHOD(Timer, getMilliseconds), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2269  r = engine->RegisterObjectMethod("Timer", "uint getMicroseconds()", asMETHOD(Timer, getMicroseconds), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2270  r = engine->RegisterObjectMethod("Timer", "uint getMillisecondsCPU()", asMETHOD(Timer, getMillisecondsCPU), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2271  r = engine->RegisterObjectMethod("Timer", "uint getMicrosecondsCPU()", asMETHOD(Timer, getMicrosecondsCPU), asCALL_THISCALL); ROR_ASSERT(r >= 0);
2272 
2273  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2274 }
2275 
2276 void registerOgreGpuProgramParameters(AngelScript::asIScriptEngine* engine)
2277 {
2278  int r;
2279 
2280  r = engine->SetDefaultNamespace("Ogre"); ROR_ASSERT(r >= 0);
2281 
2282  // Note: The `*SharedPtr` is a deprecated alias of `*Ptr` in OGRE 14, but it's not yet present in the version we use.
2283  r = engine->RegisterObjectBehaviour("GpuProgramParametersPtr", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(GpuProgramParametersPtrDefaultConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2284  r = engine->RegisterObjectBehaviour("GpuProgramParametersPtr", asBEHAVE_CONSTRUCT, "void f(const GpuProgramParametersPtr&in)", asFUNCTION(GpuProgramParametersPtrCopyConstructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2285  r = engine->RegisterObjectBehaviour("GpuProgramParametersPtr", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(GpuProgramParametersPtrDestructor), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2286  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "GpuProgramParametersPtr& opAssign(const GpuProgramParametersPtr&in)", asFUNCTION(GpuProgramParametersPtrAssignOperator), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2287  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "bool isNull()", asFUNCTION(GpuProgramParametersPtrIsNull), asCALL_CDECL_OBJLAST); ROR_ASSERT(r >= 0);
2288 
2289  // Wrappers are inevitable, see https://www.gamedev.net/forums/topic/540419-custom-smartpointers-and-angelscript-/
2290 
2291  // > setConstant (scalar)
2292  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, float val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, float val) {
2293  try { self->setConstant(index, val); }
2294  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, float)"); }
2295  }, (GpuProgramParametersPtr const&, asUINT, float), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2296  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const vector3& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, const Ogre::Vector3& val) {
2297  try { self->setConstant(index, val); }
2298  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, vector3)"); }
2299  }, (GpuProgramParametersPtr const&, asUINT, const Ogre::Vector3&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2300  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const vector2& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, const Ogre::Vector2& val) {
2301  try { self->setConstant(index, val); }
2302  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, vector2)"); }
2303  }, (GpuProgramParametersPtr const&, asUINT, const Ogre::Vector2&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2304  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const color& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, const Ogre::ColourValue& val) {
2305  try { self->setConstant(index, val); }
2306  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, color)"); }
2307  }, (GpuProgramParametersPtr const&, asUINT, const Ogre::ColourValue&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2308 
2309  // > setConstant (vector)
2310  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const array<float>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, CScriptArray* vals) {
2311  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("float"));
2312  try { self->setConstant(index, (float*)vals->GetBuffer(), vals->GetSize()); }
2313  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, array<float>)"); }
2314  }, (GpuProgramParametersPtr const&, asUINT, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2315  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const array<vector3>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, CScriptArray* vals) {
2316  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("vector3"));
2317  try { self->setConstant(index, (float*)vals->GetBuffer(), vals->GetSize()*3); }
2318  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, array<vector3>)"); }
2319  }, (GpuProgramParametersPtr const&, asUINT, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2320  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const array<vector2>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, CScriptArray* vals) {
2321  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("vector2"));
2322  try { self->setConstant(index, (float*)vals->GetBuffer(), vals->GetSize()*2); }
2323  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, array<vector2>)"); }
2324  }, (GpuProgramParametersPtr const&, asUINT, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2325  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setConstant(uint index, const array<color>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, asUINT index, CScriptArray* vals) {
2326  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("color"));
2327  try { self->setConstant(index, (float*)vals->GetBuffer(), vals->GetSize()*4); }
2328  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setConstant(uint, array<color>)"); }
2329  }, (GpuProgramParametersPtr const&, asUINT, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2330 
2331  // > setNamedConstant (scalar)
2332  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, float val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, float val) {
2333  try { self->setNamedConstant(name, val); }
2334  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, float)"); }
2335  }, (GpuProgramParametersPtr const&, const std::string&, float), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2336  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const vector3& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, const Ogre::Vector3& val) {
2337  try { self->setNamedConstant(name, val); }
2338  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, vector3)"); }
2339  }, (GpuProgramParametersPtr const&, const std::string&, const Ogre::Vector3&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2340  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const vector2& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, const Ogre::Vector2& val) {
2341  try { self->setNamedConstant(name, val); }
2342  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, vector2)"); }
2343  }, (GpuProgramParametersPtr const&, const std::string&, const Ogre::Vector2&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2344  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const color& val)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, const Ogre::ColourValue& val) {
2345  try { self->setNamedConstant(name, val); }
2346  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, color)"); }
2347  }, (GpuProgramParametersPtr const&, const std::string&, const Ogre::ColourValue&), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2348 
2349  // > setNamedConstant (vector)
2350  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const array<float>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, CScriptArray* vals) {
2351  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("float"));
2352  try { self->setNamedConstant(name, (float*)vals->GetBuffer(), vals->GetSize()); }
2353  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, array<float>)"); }
2354  }, (GpuProgramParametersPtr const&, const std::string&, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2355  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const array<vector3>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, CScriptArray* vals) {
2356  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("vector3"));
2357  try { self->setNamedConstant(name, (float*)vals->GetBuffer(), vals->GetSize()*3); }
2358  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, array<vector3>)"); }
2359  }, (GpuProgramParametersPtr const&, const std::string&, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2360  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const array<vector2>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, CScriptArray* vals) {
2361  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("vector2"));
2362  try { self->setNamedConstant(name, (float*)vals->GetBuffer(), vals->GetSize()*2); }
2363  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, array<vector2>)"); }
2364  }, (GpuProgramParametersPtr const&, const std::string&, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2365  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "void setNamedConstant(const string&in name, const array<color>@ vals)", asFUNCTIONPR([](GpuProgramParametersPtr const& self, const std::string& name, CScriptArray* vals) {
2366  ROR_ASSERT(vals->GetElementTypeId() == App::GetScriptEngine()->getEngine()->GetTypeIdByDecl("color"));
2367  try { self->setNamedConstant(name, (float*)vals->GetBuffer(), vals->GetSize()*4); }
2368  catch (...) { App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::setNamedConstant(string, array<color>)"); }
2369  }, (GpuProgramParametersPtr const&, const std::string&, CScriptArray*), void), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2370 
2371  r = engine->RegisterObjectMethod("GpuProgramParametersPtr", "array<string>@ __getNamedConstants()", asFUNCTIONPR([](GpuProgramParametersPtr const& self) -> CScriptArray* {
2372  try {
2373  std::vector<std::string> keys;
2374  const Ogre::GpuNamedConstants& namedConstants = self->getConstantDefinitions();
2375  for (auto& pair : namedConstants.map)
2376  keys.push_back(pair.first);
2377  return RoR::VectorToScriptArray(keys, "string");
2378  }
2379  catch (...) {
2380  App::GetScriptEngine()->forwardExceptionAsScriptEvent("Ogre::GpuProgramParameters::__getNamedConstants()");
2381  return nullptr; }
2382  }, (GpuProgramParametersPtr const&), CScriptArray*), asCALL_CDECL_OBJFIRST); ROR_ASSERT(r >= 0);
2383 
2384 
2385  r = engine->SetDefaultNamespace(""); ROR_ASSERT(r >= 0);
2386 }
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
MovableObjectGetUniqueNameMixin
static std::string MovableObjectGetUniqueNameMixin(Ogre::MovableObject *self)
Definition: OgreAngelscript.cpp:520
HardwarePixelBufferPtrDestructor
static void HardwarePixelBufferPtrDestructor(HardwarePixelBufferSharedPtr *self)
Definition: OgreAngelscript.cpp:279
TexturePtrIsNull
static bool TexturePtrIsNull(TexturePtr *self)
Definition: OgreAngelscript.cpp:262
MaterialPtrDefaultConstructor
static void MaterialPtrDefaultConstructor(MaterialPtr *self)
Definition: OgreAngelscript.cpp:550
Vector3InitConstructor
static void Vector3InitConstructor(float x, float y, float z, Vector3 *self)
Definition: OgreAngelscript.cpp:62
RoR::RegisterOgreObjects
void RegisterOgreObjects(AngelScript::asIScriptEngine *engine)
defined in OgreAngelscript.cpp
Definition: OgreAngelscript.cpp:683
BoxAssignOperator
static void BoxAssignOperator(const Box &other, Box *self)
Definition: OgreAngelscript.cpp:236
AnimationStateSetGetAnimationStates
static AnimationStateDict * AnimationStateSetGetAnimationStates(AnimationStateSet *self)
Definition: OgreAngelscript.cpp:537
RoR::VectorToScriptArray
AngelScript::CScriptArray * VectorToScriptArray(const std::vector< T > &vec, const std::string &decl)
Definition: ScriptUtils.h:42
MeshPtrIsNull
static bool MeshPtrIsNull(MeshPtr *self)
Definition: OgreAngelscript.cpp:359
TechniqueGetPasses
static PassArray * TechniqueGetPasses(Technique *self)
Definition: OgreAngelscript.cpp:578
y
float y
Definition: (ValueTypes) quaternion.h:6
SubMesh__getIndexBufferHelper
static AngelScript::CScriptArray * SubMesh__getIndexBufferHelper(Ogre::SubMesh *self, Ogre::HardwareIndexBuffer::IndexType desiredType)
Definition: OgreAngelscript.cpp:453
normalise
float normalise()
registerOgreTextureUnitState
void registerOgreTextureUnitState(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2246
ColourValueDefaultConstructor
static void ColourValueDefaultConstructor(ColourValue *self)
Definition: OgreAngelscript.cpp:200
MeshPtrDefaultConstructor
static void MeshPtrDefaultConstructor(MeshPtr *self)
Definition: OgreAngelscript.cpp:339
isNaN
bool isNaN() const
ImageAssignOperator
static void ImageAssignOperator(const PixelBox &other, PixelBox *self)
Definition: OgreAngelscript.cpp:326
MeshPtrCopyConstructor
static void MeshPtrCopyConstructor(const MeshPtr &other, MeshPtr *self)
Definition: OgreAngelscript.cpp:344
SubMesh__getVertexTexcoords
static AngelScript::CScriptArray * SubMesh__getVertexTexcoords(SubMesh *self, asUINT index)
Definition: OgreAngelscript.cpp:400
registerOgreEntity
void registerOgreEntity(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1546
TextureUnitStateArray
CReadonlyScriptArrayView< Ogre::TextureUnitState * > TextureUnitStateArray
Definition: OgreAngelscript.cpp:584
registerOgreQuaternion
void registerOgreQuaternion(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1312
BoxInitConstructor
static void BoxInitConstructor(asUINT l, asUINT t, asUINT r, asUINT b, Box *self)
Definition: OgreAngelscript.cpp:221
file
This is a raw Ogre binding for Imgui No project cmake file
Definition: README-OgreImGui.txt:3
Vector3CopyConstructor
static void Vector3CopyConstructor(const Vector3 &other, Vector3 *self)
Definition: OgreAngelscript.cpp:57
z
float z
Definition: (ValueTypes) quaternion.h:7
PassArray
CReadonlyScriptArrayView< Ogre::Pass * > PassArray
Definition: OgreAngelscript.cpp:576
get2DElementsHelper
AngelScript::CScriptArray * get2DElementsHelper(Ogre::Overlay *self)
Definition: OgreAngelscript.cpp:1742
ScriptValueTypes::SlerpExtraSpins
quaternion SlerpExtraSpins(float, const quaternion &in, const quaternion &in, int &in)
registerOgreDegree
void registerOgreDegree(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1231
format
Truck file format(technical spec)
RoR::CReadonlyScriptDictView
Definition: ScriptUtils.h:151
registerOgreSubEntity
void registerOgreSubEntity(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1568
BoxCopyConstructor
static void BoxCopyConstructor(const Box &other, Box *self)
Definition: OgreAngelscript.cpp:226
ScriptValueTypes::Squad
quaternion Squad(float, const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in, bool &in)
Vector3InitConstructorScaler
static void Vector3InitConstructorScaler(float s, Vector3 *self)
Definition: OgreAngelscript.cpp:67
PassGetTextureUnitStates
static TextureUnitStateArray * PassGetTextureUnitStates(Pass *self)
Definition: OgreAngelscript.cpp:586
TimerAssignOperator
static void TimerAssignOperator(const Timer &other, Timer *self)
Definition: OgreAngelscript.cpp:615
QuaternionInitConstructor5
static void QuaternionInitConstructor5(float val, Quaternion *self)
Definition: OgreAngelscript.cpp:189
RootGetSceneManagers
static SceneManagerInstanceDict * RootGetSceneManagers(Root *self)
Definition: OgreAngelscript.cpp:529
ScriptValueTypes::nlerp
quaternion nlerp(float, const quaternion &in, const quaternion &in, bool &in)
RoR::ScriptEngine::getEngine
AngelScript::asIScriptEngine * getEngine()
Definition: ScriptEngine.h:223
MaterialPtrAssignOperator
static void MaterialPtrAssignOperator(const MaterialPtr &other, MaterialPtr *self)
Definition: OgreAngelscript.cpp:565
Vector3Cmp
static int Vector3Cmp(const Vector3 &a, const Vector3 &b)
Definition: OgreAngelscript.cpp:94
SubMesh__getVertexPositions
static AngelScript::CScriptArray * SubMesh__getVertexPositions(SubMesh *self)
Definition: OgreAngelscript.cpp:365
RoR::CReadonlyScriptDictView::RegisterReadonlyScriptDictView
static void RegisterReadonlyScriptDictView(AngelScript::asIScriptEngine *engine, const char *decl, const char *value_decl)
Definition: ScriptUtils.h:198
RoR::ScriptEngine::forwardExceptionAsScriptEvent
void forwardExceptionAsScriptEvent(const std::string &from)
Forwards useful info from C++ try{}catch{} exceptions to script in the form of game event.
Definition: ScriptEngine.cpp:246
GpuProgramParametersPtrAssignOperator
static void GpuProgramParametersPtrAssignOperator(const GpuProgramParametersPtr &other, GpuProgramParametersPtr *self)
Definition: OgreAngelscript.cpp:636
MaterialPtrGetTechniques
static TechniqueArray * MaterialPtrGetTechniques(const MaterialPtr &self)
Definition: OgreAngelscript.cpp:545
registerOgreImage
void registerOgreImage(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2033
TimerCopyConstructor
static void TimerCopyConstructor(const Timer &other, Timer *self)
Definition: OgreAngelscript.cpp:610
Vector2InitConstructorScaler
static void Vector2InitConstructorScaler(float s, Vector2 *self)
Definition: OgreAngelscript.cpp:88
registerOgreMaterialManager
void registerOgreMaterialManager(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2133
Vector3DefaultConstructor
static void Vector3DefaultConstructor(Vector3 *self)
Definition: OgreAngelscript.cpp:52
registerOgreTimer
void registerOgreTimer(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2257
RoR::IterableMapToScriptArray
AngelScript::CScriptArray * IterableMapToScriptArray(ItorT begin, ItorT end, const std::string &decl)
Definition: ScriptUtils.h:78
RoR::App::GetScriptEngine
ScriptEngine * GetScriptEngine()
Definition: Application.cpp:279
TexturePtrAssignOperator
static void TexturePtrAssignOperator(const TexturePtr &other, TexturePtr *self)
Definition: OgreAngelscript.cpp:257
w
float w
Definition: (ValueTypes) quaternion.h:4
Exp
quaternion Exp() const
NodeGetChildren
static ChildNodeArray * NodeGetChildren(Ogre::Node *self)
Definition: OgreAngelscript.cpp:500
registerOgreMovableObject
void registerOgreMovableObject(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1536
MeshPtrGetSubmeshes
static SubMeshArray * MeshPtrGetSubmeshes(const MeshPtr &self)
Definition: OgreAngelscript.cpp:334
equals
bool equals(const quaternion &in, const radian &in) const
ImageDefaultConstructor
static void ImageDefaultConstructor(Image *self)
Definition: OgreAngelscript.cpp:311
registerOgreTexture
void registerOgreTexture(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1456
registerOgreNode
void registerOgreNode(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1608
registerOgreSceneNode
void registerOgreSceneNode(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1618
HardwarePixelBufferPtrCopyConstructor
static void HardwarePixelBufferPtrCopyConstructor(const HardwarePixelBufferSharedPtr &other, HardwarePixelBufferSharedPtr *self)
Definition: OgreAngelscript.cpp:274
QuaternionInitConstructor2
static void QuaternionInitConstructor2(float w, float x, float y, float z, Quaternion *self)
Definition: OgreAngelscript.cpp:178
registerOgreMesh
void registerOgreMesh(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2086
MaterialPtrIsNull
static bool MaterialPtrIsNull(MaterialPtr *self)
Definition: OgreAngelscript.cpp:570
registerOgreBox
void registerOgreBox(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1424
registerOgreColourValue
void registerOgreColourValue(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1402
MaterialPtrDestructor
static void MaterialPtrDestructor(MaterialPtr *self)
Definition: OgreAngelscript.cpp:560
DegreeInitConstructor
static void DegreeInitConstructor(float r, Degree *self)
Definition: OgreAngelscript.cpp:147
RadianDefaultConstructor
static void RadianDefaultConstructor(Radian *self)
Definition: OgreAngelscript.cpp:111
HardwarePixelBufferPtrDefaultConstructor
static void HardwarePixelBufferPtrDefaultConstructor(HardwarePixelBufferSharedPtr *self)
Definition: OgreAngelscript.cpp:269
BoxDestructor
static void BoxDestructor(Box *self)
Definition: OgreAngelscript.cpp:231
RadianInitConstructor
static void RadianInitConstructor(float r, Radian *self)
Definition: OgreAngelscript.cpp:121
ScriptEngine.h
GpuProgramParametersPtrIsNull
static bool GpuProgramParametersPtrIsNull(GpuProgramParametersPtr *self)
Definition: OgreAngelscript.cpp:641
SubEntityArray
CReadonlyScriptArrayView< Ogre::SubEntity * > SubEntityArray
Definition: OgreAngelscript.cpp:592
DegreeCopyConstructor
static void DegreeCopyConstructor(const Degree &other, Degree *self)
Definition: OgreAngelscript.cpp:142
MovableObjectArray
CReadonlyScriptArrayView< Ogre::MovableObject * > MovableObjectArray
Definition: OgreAngelscript.cpp:512
registerOgreManualObject
void registerOgreManualObject(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1929
registerOgreSubMesh
void registerOgreSubMesh(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2058
PixelBoxDestructor
static void PixelBoxDestructor(PixelBox *self)
Definition: OgreAngelscript.cpp:300
RoR::CReadonlyScriptArrayView::RegisterReadonlyScriptArrayView
static void RegisterReadonlyScriptArrayView(AngelScript::asIScriptEngine *engine, const char *decl, const char *value_decl)
Definition: ScriptUtils.h:239
Application.h
Central state/object manager and communications hub.
QuaternionInitConstructor1
static void QuaternionInitConstructor1(const Radian &rfAngle, const Vector3 &rkAxis, Quaternion *self)
Definition: OgreAngelscript.cpp:173
MaterialPtrCopyConstructor
static void MaterialPtrCopyConstructor(const MaterialPtr &other, MaterialPtr *self)
Definition: OgreAngelscript.cpp:555
Vector2InitConstructor
static void Vector2InitConstructor(float x, float y, Vector2 *self)
Definition: OgreAngelscript.cpp:83
registerOgreVector3
void registerOgreVector3(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:907
PIXELBOX_DUMMY
static PixelBox PIXELBOX_DUMMY
Definition: OgreAngelscript.cpp:1954
AngelOgre::Slerp
class AngelOgre::AnimationState Slerp
registerOgreVector2
void registerOgreVector2(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1038
registerOgreRadian
void registerOgreRadian(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1150
getYaw
radian getYaw(bool reprojectAxis=true) const
TechniqueArray
CReadonlyScriptArrayView< Ogre::Technique * > TechniqueArray
Definition: OgreAngelscript.cpp:543
QuaternionInitConstructorScaler
static void QuaternionInitConstructorScaler(float s, Quaternion *self)
Definition: OgreAngelscript.cpp:194
registerOgrePixelBox
void registerOgrePixelBox(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2004
TimerDefaultConstructor
static void TimerDefaultConstructor(Timer *self)
Definition: OgreAngelscript.cpp:600
getRoll
radian getRoll(bool reprojectAxis=true) const
SceneNodeGetAttachedObjects
static MovableObjectArray * SceneNodeGetAttachedObjects(SceneNode *self)
Definition: OgreAngelscript.cpp:514
MeshPtrDestructor
static void MeshPtrDestructor(MeshPtr *self)
Definition: OgreAngelscript.cpp:349
GpuProgramParametersPtrDestructor
static void GpuProgramParametersPtrDestructor(GpuProgramParametersPtr *self)
Definition: OgreAngelscript.cpp:631
GpuProgramParametersPtrDefaultConstructor
static void GpuProgramParametersPtrDefaultConstructor(GpuProgramParametersPtr *self)
Definition: OgreAngelscript.cpp:621
registerOgreOverlay
void registerOgreOverlay(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1773
registerOgreSceneManager
void registerOgreSceneManager(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1660
TexturePtrDestructor
static void TexturePtrDestructor(TexturePtr *self)
Definition: OgreAngelscript.cpp:252
ColourValueCopyConstructor
static void ColourValueCopyConstructor(const ColourValue &other, ColourValue *self)
Definition: OgreAngelscript.cpp:210
getPitch
radian getPitch(bool reprojectAxis=true) const
HardwarePixelBufferPtrAssignOperator
static void HardwarePixelBufferPtrAssignOperator(const HardwarePixelBufferSharedPtr &other, HardwarePixelBufferSharedPtr *self)
Definition: OgreAngelscript.cpp:284
Dot
float Dot(const quaternion &in) const
SubMeshArray
CReadonlyScriptArrayView< Ogre::SubMesh * > SubMeshArray
Definition: OgreAngelscript.cpp:332
registerOgreMeshManager
void registerOgreMeshManager(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2112
DegreeDefaultConstructor
static void DegreeDefaultConstructor(Degree *self)
Definition: OgreAngelscript.cpp:137
QuaternionInitConstructor3
static void QuaternionInitConstructor3(const Vector3 &xaxis, const Vector3 &yaxis, const Vector3 &zaxis, Quaternion *self)
Definition: OgreAngelscript.cpp:183
Norm
float Norm() const
PixelBoxAssignOperator
static void PixelBoxAssignOperator(const PixelBox &other, PixelBox *self)
Definition: OgreAngelscript.cpp:305
registerOgreMaterial
void registerOgreMaterial(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2154
ColourValueInitConstructor
static void ColourValueInitConstructor(float r, float g, float b, float a, ColourValue *self)
Definition: OgreAngelscript.cpp:205
QuaternionCopyConstructor
static void QuaternionCopyConstructor(const Quaternion &other, Quaternion *self)
Definition: OgreAngelscript.cpp:168
registerOgreTechnique
void registerOgreTechnique(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2185
BoxDefaultConstructor
static void BoxDefaultConstructor(Box *self)
Definition: OgreAngelscript.cpp:216
Vector2CopyConstructor
static void Vector2CopyConstructor(const Vector2 &other, Vector2 *self)
Definition: OgreAngelscript.cpp:78
Inverse
quaternion Inverse() const
GpuProgramParametersPtrCopyConstructor
static void GpuProgramParametersPtrCopyConstructor(const GpuProgramParametersPtr &other, GpuProgramParametersPtr *self)
Definition: OgreAngelscript.cpp:626
ScriptValueTypes::Intermediate
void Intermediate(const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in, const quaternion &in)
registerOgreNodeBase
void registerOgreNodeBase(AngelScript::asIScriptEngine *engine, const char *obj)
Definition: OgreAngelscript.cpp:1581
Ogre
Definition: ExtinguishableFireAffector.cpp:35
ScriptUtils.h
RadianCmp
static int RadianCmp(const Radian &a, const Radian &b)
Definition: OgreAngelscript.cpp:126
registerOgreTextureManager
void registerOgreTextureManager(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1487
ImageDestructor
static void ImageDestructor(PixelBox *self)
Definition: OgreAngelscript.cpp:321
registerOgreAnimationStateSet
void registerOgreAnimationStateSet(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1727
ImageCopyConstructor
static void ImageCopyConstructor(const Image &other, Image *self)
Definition: OgreAngelscript.cpp:316
registerOgreHardwarePixelBuffer
void registerOgreHardwarePixelBuffer(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1956
TexturePtrCopyConstructor
static void TexturePtrCopyConstructor(const TexturePtr &other, TexturePtr *self)
Definition: OgreAngelscript.cpp:247
SubMesh__getIndexType
static Ogre::HardwareIndexBuffer::IndexType SubMesh__getIndexType(SubMesh *self)
Definition: OgreAngelscript.cpp:437
EntityGetSubEntities
static SubEntityArray * EntityGetSubEntities(Entity *self)
Definition: OgreAngelscript.cpp:594
RoR::CReadonlyScriptArrayView
Definition: ScriptUtils.h:229
TimerDefaultDestructor
static void TimerDefaultDestructor(Timer *self)
Definition: OgreAngelscript.cpp:605
registerOgreRoot
void registerOgreRoot(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1685
PixelBoxCopyConstructor
static void PixelBoxCopyConstructor(const PixelBox &other, PixelBox *self)
Definition: OgreAngelscript.cpp:295
SceneManagerInstanceDict
CReadonlyScriptDictView< SceneManager * > SceneManagerInstanceDict
Definition: OgreAngelscript.cpp:527
QuaternionDefaultConstructor
static void QuaternionDefaultConstructor(Quaternion *self)
Definition: OgreAngelscript.cpp:163
Vector2DefaultConstructor
static void Vector2DefaultConstructor(Vector2 *self)
Definition: OgreAngelscript.cpp:73
registerOgreGpuProgramParameters
void registerOgreGpuProgramParameters(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2276
AnimationStateDict
CReadonlyScriptDictView< AnimationState * > AnimationStateDict
Definition: OgreAngelscript.cpp:535
getElementTemplatesHelper
AngelScript::CScriptArray * getElementTemplatesHelper(Ogre::OverlayManager *self)
Definition: OgreAngelscript.cpp:1758
RadianCopyConstructor
static void RadianCopyConstructor(const Radian &other, Radian *self)
Definition: OgreAngelscript.cpp:116
registerOgreAnimationState
void registerOgreAnimationState(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:1698
TexturePtrDefaultConstructor
static void TexturePtrDefaultConstructor(TexturePtr *self)
Definition: OgreAngelscript.cpp:242
DegreeCmp
static int DegreeCmp(const Degree &a, const Degree &b)
Definition: OgreAngelscript.cpp:152
RoR
Definition: AppContext.h:36
NodeGetUniqueNameMixin
static std::string NodeGetUniqueNameMixin(Ogre::Node *self)
Definition: OgreAngelscript.cpp:505
x
float x
Definition: (ValueTypes) quaternion.h:5
ChildNodeArray
CReadonlyScriptArrayView< Ogre::Node * > ChildNodeArray
Definition: OgreAngelscript.cpp:498
registerOgreMovableObjectBase
void registerOgreMovableObjectBase(AngelScript::asIScriptEngine *engine, const char *obj)
Definition: OgreAngelscript.cpp:1505
PixelBoxDefaultConstructor
static void PixelBoxDefaultConstructor(PixelBox *self)
Definition: OgreAngelscript.cpp:290
Log
quaternion Log() const
MeshPtrAssignOperator
static void MeshPtrAssignOperator(const MeshPtr &other, MeshPtr *self)
Definition: OgreAngelscript.cpp:354
UnitInverse
quaternion UnitInverse() const
registerOgrePass
void registerOgrePass(AngelScript::asIScriptEngine *engine)
Definition: OgreAngelscript.cpp:2197