ml_types.h
Classes
Name | |
---|---|
struct | MLVec2f |
struct | MLXYZf Internal structure used to simplify access of MLVec3f. Do not create this structure directly and always use MLVec3f instead. |
struct | MLVec3f |
struct | MLQuaternionf |
struct | MLTransform |
struct | MLMat4f |
struct | MLRectf |
struct | MLRecti |
struct | MLColor32 |
struct | MLColor4f |
struct | MLUUID |
struct | MLPose |
Types
Name | |
---|---|
typedef struct MLVec2f | MLVec2f |
typedef struct MLXYZf | MLXYZf Internal structure used to simplify access of MLVec3f. Do not create this structure directly and always use MLVec3f instead. |
typedef struct MLVec3f | MLVec3f |
typedef struct MLQuaternionf | MLQuaternionf |
typedef struct MLTransform | MLTransform |
typedef struct MLMat4f | MLMat4f |
typedef struct MLRectf | MLRectf |
typedef struct MLRecti | MLRecti |
typedef struct MLColor32 | MLColor32 |
typedef struct MLColor4f | MLColor4f |
typedef struct MLUUID | MLUUID |
typedef int64_t | MLTime |
typedef struct MLPose | MLPose |
Types Documentation
MLVec2f
typedef struct MLVec2f MLVec2f;
2D vector represented with X and Y floats.
MLXYZf
typedef struct MLXYZf MLXYZf;
Internal structure used to simplify access of MLVec3f. Do not create this structure directly and always use MLVec3f instead.
MLVec3f
typedef struct MLVec3f MLVec3f;
3D vector represented with X, Y, and Z floats.
MLQuaternionf
typedef struct MLQuaternionf MLQuaternionf;
Quaternion stored as X, Y, Z, W floats.
MLTransform
typedef struct MLTransform MLTransform;
Information used to transform from one coordinate frame to another.
MLMat4f
typedef struct MLMat4f MLMat4f;
An arbitrary 4x4 matrix represented with an array of floats.
MLRectf
typedef struct MLRectf MLRectf;
A 2D float rectangle.
MLRecti
typedef struct MLRecti MLRecti;
A 2D integer rectangle.
MLColor32
typedef struct MLColor32 MLColor32;
Color represented by 4 unsigned bytes.
MLColor4f
typedef struct MLColor4f MLColor4f;
Color represented by 4 floats.
MLUUID
typedef struct MLUUID MLUUID;
Universally Unique Identifier.
MLTime
typedef int64_t MLTime;
Represents an ML API wide timestamp in nanoseconds that is not guaranteed to be synced with any system time.
MLPose
typedef struct MLPose MLPose;
Geometric relationship between two coordinate frames.
Source code
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2017 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
#pragma once
#include "ml_api.h"
ML_EXTERN_C_BEGIN
typedef struct MLVec2f {
float x;
float y;
} MLVec2f;
typedef struct MLXYZf {
float x;
float y;
float z;
} MLXYZf;
typedef struct MLVec3f {
union {
MLXYZf xyz;
float values[3];
struct {
float x;
float y;
float z;
};
};
} MLVec3f;
typedef struct MLQuaternionf {
union {
float values[4];
struct {
float x;
float y;
float z;
float w;
};
};
} MLQuaternionf;
typedef struct MLTransform {
MLQuaternionf rotation;
MLVec3f position;
} MLTransform;
typedef struct MLMat4f {
float matrix_colmajor[16];
} MLMat4f;
typedef struct MLRectf {
float x;
float y;
float w;
float h;
} MLRectf;
typedef struct MLRecti {
int32_t x;
int32_t y;
int32_t w;
int32_t h;
} MLRecti;
typedef struct MLColor32 {
union {
struct {
uint8_t a;
uint8_t b;
uint8_t g;
uint8_t r;
};
uint32_t rgba;
};
} MLColor32;
typedef struct MLColor4f {
float r;
float g;
float b;
float a;
} MLColor4f;
typedef struct MLUUID {
union {
struct {
uint32_t time_low;
uint16_t time_mid;
uint16_t time_hi_and_version;
uint8_t clock_seq_hi_and_reserved;
uint8_t clock_seq_low;
uint8_t node[6];
};
uint8_t data[16];
};
} MLUUID;
typedef int64_t MLTime;
typedef struct MLPose {
MLTransform transform;
bool has_derivatives;
MLVec3f linear_velocity;
MLVec3f linear_acceleration;
MLVec3f angular_velocity;
MLVec3f angular_acceleration;
MLTime origin_time_ns;
MLTime predict_time_ns;
} MLPose;
ML_EXTERN_C_END