|
@@ -14625,96 +14625,6 @@ return {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- name = "lookAt",
|
|
|
- summary = "Compute an angle/axis rotation from a vector.",
|
|
|
- description = "Returns the angle/axis orientation to use to get an object to look at a point.",
|
|
|
- key = "lovr.math.lookAt",
|
|
|
- module = "lovr.math",
|
|
|
- notes = "With the default up vector, strange things will happen when trying to look in directions that line up with the up vector, similar to how the cameras in a first person shooter work. Sometimes this is alright, but other times you may want to keep track of the up vector of the camera as it rotates and pass that in as the up vector to avoid issues.",
|
|
|
- variants = {
|
|
|
- {
|
|
|
- arguments = {
|
|
|
- {
|
|
|
- name = "x",
|
|
|
- type = "number",
|
|
|
- description = "The x position of the object."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "y",
|
|
|
- type = "number",
|
|
|
- description = "The y position of the object."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "z",
|
|
|
- type = "number",
|
|
|
- description = "The z position of the object."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "tx",
|
|
|
- type = "number",
|
|
|
- description = "The x position of the target to look at."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "ty",
|
|
|
- type = "number",
|
|
|
- description = "The y position of the target to look at."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "tz",
|
|
|
- type = "number",
|
|
|
- description = "The z position of the target to look at."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "ux",
|
|
|
- type = "number",
|
|
|
- description = "The x component of the global up vector.",
|
|
|
- default = "0"
|
|
|
- },
|
|
|
- {
|
|
|
- name = "uy",
|
|
|
- type = "number",
|
|
|
- description = "The y component of the global up vector.",
|
|
|
- default = "1"
|
|
|
- },
|
|
|
- {
|
|
|
- name = "uz",
|
|
|
- type = "number",
|
|
|
- description = "The z component of the global up vector.",
|
|
|
- default = "0"
|
|
|
- }
|
|
|
- },
|
|
|
- returns = {
|
|
|
- {
|
|
|
- name = "angle",
|
|
|
- type = "number",
|
|
|
- description = "The number of radians to rotate around the axis of rotation."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "ax",
|
|
|
- type = "number",
|
|
|
- description = "The x component of the axis of rotation."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "ay",
|
|
|
- type = "number",
|
|
|
- description = "The y component of the axis of rotation."
|
|
|
- },
|
|
|
- {
|
|
|
- name = "az",
|
|
|
- type = "number",
|
|
|
- description = "The z component of the axis of rotation."
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- examples = {
|
|
|
- {
|
|
|
- description = "Rotate a texture so it always faces the headset.",
|
|
|
- code = "function lovr.load()\n eye = lovr.graphics.newTexture('texture.png')\nend\n\nfunction lovr.draw()\n local x, y, z = 0, 2, -2\n local angle, ax, ay, az = lovr.math.lookAt(x, y, z, lovr.headset.getPosition())\n lovr.graphics.plane(eye, x, y, z, 1, angle, ax, ay, az)\nend"
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
{
|
|
|
name = "mat4",
|
|
|
summary = "Create a new mat4.",
|