فهرست منبع

lovr.graphics.getViewPose; lovr.graphics.setViewPose;

bjorn 4 سال پیش
والد
کامیت
2a5856d189
3فایلهای تغییر یافته به همراه421 افزوده شده و 1546 حذف شده
  1. 274 1546
      api/init.lua
  2. 70 0
      api/lovr/graphics/getViewPose.lua
  3. 77 0
      api/lovr/graphics/setViewPose.lua

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 274 - 1546
api/init.lua


+ 70 - 0
api/lovr/graphics/getViewPose.lua

@@ -0,0 +1,70 @@
+return {
+  tag = 'graphicsState',
+  summary = 'Get the camera pose.',
+  description = 'Get the pose of a single view.',
+  arguments = {
+    view = {
+      type = 'number',
+      description = 'The view index.'
+    },
+    matrix = {
+      type = 'Mat4',
+      description = 'The matrix to fill with the view pose.'
+    },
+    invert = {
+      type = 'boolean',
+      description = 'Whether the matrix should be inverted.'
+    }
+  },
+  returns = {
+    x = {
+      type = 'number',
+      description = 'The x position of the viewer, in meters.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y position of the viewer, in meters.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z position of the viewer, in meters.'
+    },
+    angle = {
+      type = 'number',
+      description = 'The number of radians the viewer is rotated around its axis of rotation.'
+    },
+    ax = {
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    },
+    matrix = {
+      type = 'Mat4',
+      description = 'The original matrix.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'view' },
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    },
+    {
+      arguments = { 'view', 'matrix', 'invert' },
+      returns = { 'matrix' }
+    }
+  },
+  related = {
+    'lovr.headset.getViewPose',
+    'lovr.headset.setViewPose',
+    'lovr.headset.getViewCount',
+    'lovr.graphics.getProjection',
+    'lovr.graphics.setProjection'
+  }
+}

+ 77 - 0
api/lovr/graphics/setViewPose.lua

@@ -0,0 +1,77 @@
+return {
+  tag = 'graphicsState',
+  summary = 'Set the camera pose.',
+  description = [[
+    Sets the pose for a single view.  Objects rendered in this view will appear as though the camera
+    is positioned using the given pose.
+
+    Two views are supported, one for each eye.  When rendering to the headset, both views are
+    changed to match the estimated eye positions.  These view poses are also available using
+    `lovr.headset.getViewPose`.
+  ]],
+  arguments = {
+    view = {
+      type = 'number',
+      description = 'The index of the view to update.'
+    },
+    x = {
+      type = 'number',
+      description = 'The x position of the viewer, in meters.'
+    },
+    y = {
+      type = 'number',
+      description = 'The y position of the viewer, in meters.'
+    },
+    z = {
+      type = 'number',
+      description = 'The z position of the viewer, in meters.'
+    },
+    angle = {
+      type = 'number',
+      description = 'The number of radians the viewer is rotated around its axis of rotation.'
+    },
+    ax = {
+      type = 'number',
+      description = 'The x component of the axis of rotation.'
+    },
+    ay = {
+      type = 'number',
+      description = 'The y component of the axis of rotation.'
+    },
+    az = {
+      type = 'number',
+      description = 'The z component of the axis of rotation.'
+    },
+    matrix = {
+      type = 'Mat4',
+      description = 'A matrix containing the viewer pose.'
+    },
+    inverted = {
+      type = 'boolean',
+      description = 'Whether the matrix is an inverted pose (a view matrix).'
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'view', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    },
+    {
+      arguments = { 'view', 'matrix', 'inverted' },
+      returns = {}
+    }
+  },
+  notes = [[
+    Non-stereo rendering will only use the first view.
+
+    The inverted view pose (view matrix) is available as a `mat4 lovrViews[2]` variable in shaders.
+  ]],
+  related = {
+    'lovr.headset.getViewPose',
+    'lovr.headset.setViewPose',
+    'lovr.headset.getViewCount',
+    'lovr.graphics.getProjection',
+    'lovr.graphics.setProjection'
+  }
+}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است