8 #ifndef Navigation_DisplayList_H
9 #define Navigation_DisplayList_H
20 class DisplayListData;
21 class IVisualGeometry;
22 class VisualDebugServer;
30 class DatabaseGenMetrics;
53 #ifdef KY_BUILD_SHIPPING
54 # define KY_DISABLE_DISPLAYLIST
57 #ifndef KY_DISABLE_DISPLAYLIST
62 class DisplayListManager;
131 class ScopedDisplayList
296 void PushOrientedBox(
const Transform& transform,
const Box3f& extents,
const VisualShapeColor& color);
297 void PushOrientedBox2d(
const OrientedBox2d& orientedBox2d,
const VisualShapeColor& color);
314 void PushBox(
const Box3f& box,
const VisualShapeColor& color);
342 void PushSegmentBasedShape(
const Vec3f& P,
const Vec3f& Q,
KyFloat32 size,
const VisualShapeColor& color,
KyUInt32 displayShapeType);
344 void PushText(DisplayText& text);
345 void PushShape(DisplayShape& shape);
358 DisplayListData* m_displayListData;
364 class DisplayListManager
369 DisplayListManager();
370 ~DisplayListManager();
372 void SetVisualDebugServer(VisualDebugServer* visualDebugServer) { m_visualDebugServer = visualDebugServer; }
373 bool IsVisualDebugSupported();
386 VisualDebugServer* m_visualDebugServer;
388 BlobHandler<DisplayListBlob> m_workingDisplayListBlobHandler;
389 KyArray<DisplayListData*> m_displayListDataPool;
393 KyArrayPOD<char> m_displayListBlobsToRenderBuffer;
394 Ptr<IVisualGeometry> m_visualGeometry;
397 DisplayListData* GetNewDisplayListData();
398 void SendDisplayListData(DisplayListData* displayListData);
399 void ReleaseDisplayListData(DisplayListData* displayListData);
402 void AddDisplayListBlobToRender(
const char* displayListBlob,
KyUInt32 blobsize);
403 DisplayListBlob* GetNextDisplayListBlobToRender(
KyUInt32& sizeRead);
404 void ClearDisplayListBlobsToRender();
407 void SetVisualGeometry(IVisualGeometry* visualGeometry);
408 IVisualGeometry* GetVisualGeometry() {
return m_visualGeometry; }
409 bool IsVisualGeometrySupported() {
return m_visualGeometry !=
KY_NULL; }
411 void BuildVisualGeometry();
420 #else // KY_DISABLE_DISPLAYLIST
431 class DisplayListManager :
public DisabledDisplayListManager
435 class ScopedDisplayList :
public DisabledScopedDisplayList
441 : DisabledScopedDisplayList(manager, activation)
445 : DisabledScopedDisplayList(world, activation)
454 #endif // KY_DISABLE_DISPLAYLIST
457 #endif // Navigation_DisplayList_H
void PushCorona(const Vec3f &P, KyFloat32 innerRadius, KyFloat32 outerRadius, KyUInt32 subdivisions, const VisualShapeColor &color)
Pushes a 2D flat corona centered on P.
void InitUserControlledLifespan_AssociateWithWorldElement(const char listName[64], const char groupName[64], KyUInt32 worldElementId)
Associate the displayList to the given world element and so the list can then be turned on/off under ...
void PushDiskSector(const Vec3f &P, KyFloat32 radius, const Vec3f &startPos, const Vec3f &endPos, const RotationDirection rotDir, KyUInt32 subdivisionCount, const VisualShapeColor &color)
Pushes a 2D flat disk sector centered on P, between start and end positions (on the circle)...
void PushColumn(const Vec3f &P, KyFloat32 halfWidth, KyFloat32 height, const VisualShapeColor &color)
Pushes an axis-aligned box whose base is centered on P.
Game side: Manages all DisplayListData, send them to the NavigationLab.
Definition: displaylist.h:409
void PushDisk(const Vec3f &P, KyFloat32 radius, KyUInt32 subdivisions, const VisualShapeColor &color)
Pushes a 2D flat disk centered on P.
This class represents a two-dimensional axis-aligned bounding box whose dimensions are stored using 3...
Definition: box2i.h:119
void PushTextVarg(const Vec3f &pos, const VisualColor &color, const char *textFmt,...)
Pushes a text.
This class represents a three-dimensional bounding box with a free orientation on the (X...
Definition: orientedbox2d.h:53
void ShowInLabWhenSelected(bool showInLabWhenSelected)
Makes the NavigationLab display or hide the displayList when the corresponding Element (Bot...
void PushVerticalCylinder(const Vec3f &P, KyFloat32 radius, KyFloat32 height, KyUInt32 subdivisions, const VisualShapeColor &color)
Pushes a cylinder whose base is centered on P.
void PushChristmasTree(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color)
Pushes a Christmas tree: two orthogonal triangles with the same central axes.
void ShowInLabWhenNotSelected(bool showInLabWhenNotSelected)
Makes the NavigationLab display or hide the displayList when the corresponding Element (Bot...
This class represents a triangle in three-dimensional space, whose dimensions are stored using float ...
Definition: triangle3f.h:22
KyUInt32 GenerateDisplayListId()
Returns a unique display list ID, which you can use when creating a new ScopedDisplayList with a user...
Calls on the ScopedDisplayList will do nothing.
Definition: displaylist.h:39
#define KY_NULL
Null value.
Definition: types.h:247
KyUInt32 InitUserControlledLifespan(const char listName[64], const char groupName[64], KyUInt32 displayListId)
group all displayLists with the same groupName under the same label
The display list is activated.
Definition: displaylist.h:40
void PushPyramid(const Vec3f &P, const Vec3f &Q, KyFloat32 halfWidth, const VisualShapeColor &color)
Push a pyramid composed of a base and four sides. P the is center of the base, Q is the peak...
void PushQuad(const Vec3f &A, const Vec3f &B, KyFloat32 radius, const VisualShapeColor &color)
Pushes a flat Quad.
Represents a single RGBA color.
Definition: visualcolor.h:19
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:20
void PushTriangle(const Vec3f &A, const Vec3f &B, const Vec3f &C, const VisualShapeColor &color)
Pushes a single triangle.
This class represents a three-dimensional axis-aligned bounding box whose dimensions are stored using...
Definition: box3f.h:25
void PushBezierArrow(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color, KyFloat32 headWidthRatio=3.0f, KyUInt32 directionnality=0)
Pushes a bezier arrow from P to Q.
void PushArrow(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color, KyFloat32 headWidthRatio=3.0f, KyFloat32 headLengthRatio=0.33f)
Pushes an arrow from P to Q.
void PushDoubleSilex(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color)
Pushes a double silex from P to Q with the specified bodyHalfWidth.
void InitSingleFrameLifespan(const char listName[64], const char groupName[64])
group all displayLists with the same groupName under the same label
Definition: gamekitcrowddispersion.h:20
void PushWall(const Vec3f &P, const Vec3f &Q, KyFloat32 upHeight, KyFloat32 downHeight, KyFloat32 halfWidth, const VisualShapeColor &color)
Pushes a three-dimensional oriented box.
void PushSilex(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color)
Pushes a silex from P to Q with the specified bodyHalfWidth.
void PushPoint(const Vec3f &P, const VisualShapeColor &color)
Pushes an axis-aligned box centered on P. Or, a cross made of lines.
Definition: displaylist.h:275
void PushCrossedRectangles(const Vec3f &P, const Vec3f &Q, KyFloat32 bodyHalfWidth, const VisualShapeColor &color)
Pushes two orthogonal rectangles with the same central axes.
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
#define KY_DEPRECATED(f)
Macro to mark a function, class or method as deprecated.
Definition: types.h:289
void SubmitToRenderer()
Changed for consistency, please use BuildVisualGeometry instead.
Definition: displaylist.h:465
ScopedDisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:136
void RemoveDisplayList(KyUInt32 displayListId)
Stops rendering the display list with the specified ID.
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
void PushBox(const Box3f &box, const VisualShapeColor &color)
Pushes an axis-aligned box.
void PushLine(const Vec3f &P, const Vec3f &Q, const VisualColor &color, KyFloat32 pixelWidth=1.f)
Pushes a line.
void PushCellBox(const Box2i &cellBox, const KyFloat32 altitudeMinMax[], const DatabaseGenMetrics &genMetrics, const VisualShapeColor &color)
Pushes a Box from a CellBox using -altitude and +altitude for z values for min and max...
void PushPoint_Tetrahedron(const Vec3f &P, KyFloat32 halfWidth, const VisualShapeColor &color)
Pushes an axis-aligned tetrahedron centered on P and pointing down.
void PushSquareTubeSegment(const Vec3f &P, const Vec3f &Q, KyFloat32 halfWidth, const VisualShapeColor &color)
Pushes a hollow tube with a square cross-section.
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
void ShowInLab(bool showInLab)
Makes the NavigationLab hide the displayList whether it's selected or NOT selected. The NavigationLab UI allows to override this.
This class gathers a set of generation parameters of one Database and manages the conversion between ...
Definition: databasegenmetrics.h:24
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
void PushTriangleTubeSegment(const Vec3f &P, const Vec3f &Q, KyFloat32 halfWidth, const VisualShapeColor &color)
Pushes a hollow tube with a triangular cross-section.
DisplayListActivation
Indicates if the display list is active or not.
Definition: displaylist.h:37
void PushSegment(const Vec3f &A, const Vec3f &B, KyFloat32 radius, const VisualShapeColor &color)
Pushes a segment. P and Q are the centers of the two opposite ends, and halfWidth is half the width o...