├── README.md ├── api ├── conf.lua ├── generators │ ├── cats.lua │ └── lua.lua ├── init.lua ├── lovr │ ├── Object │ │ ├── init.lua │ │ ├── release.lua │ │ └── type.lua │ ├── audio │ │ ├── AudioMaterial.lua │ │ ├── AudioShareMode.lua │ │ ├── AudioType.lua │ │ ├── Effect.lua │ │ ├── Source │ │ │ ├── clone.lua │ │ │ ├── getDirectivity.lua │ │ │ ├── getDuration.lua │ │ │ ├── getOrientation.lua │ │ │ ├── getPitch.lua │ │ │ ├── getPose.lua │ │ │ ├── getPosition.lua │ │ │ ├── getRadius.lua │ │ │ ├── getSound.lua │ │ │ ├── getVolume.lua │ │ │ ├── init.lua │ │ │ ├── isEffectEnabled.lua │ │ │ ├── isLooping.lua │ │ │ ├── isPlaying.lua │ │ │ ├── isSpatial.lua │ │ │ ├── pause.lua │ │ │ ├── play.lua │ │ │ ├── seek.lua │ │ │ ├── setDirectivity.lua │ │ │ ├── setEffectEnabled.lua │ │ │ ├── setLooping.lua │ │ │ ├── setOrientation.lua │ │ │ ├── setPitch.lua │ │ │ ├── setPose.lua │ │ │ ├── setPosition.lua │ │ │ ├── setRadius.lua │ │ │ ├── setVolume.lua │ │ │ ├── stop.lua │ │ │ └── tell.lua │ │ ├── TimeUnit.lua │ │ ├── VolumeUnit.lua │ │ ├── getAbsorption.lua │ │ ├── getDevice.lua │ │ ├── getDevices.lua │ │ ├── getOrientation.lua │ │ ├── getPose.lua │ │ ├── getPosition.lua │ │ ├── getSampleRate.lua │ │ ├── getSpatializer.lua │ │ ├── getVolume.lua │ │ ├── init.lua │ │ ├── isStarted.lua │ │ ├── newSource.lua │ │ ├── setAbsorption.lua │ │ ├── setDevice.lua │ │ ├── setGeometry.lua │ │ ├── setOrientation.lua │ │ ├── setPose.lua │ │ ├── setPosition.lua │ │ ├── setVolume.lua │ │ ├── start.lua │ │ └── stop.lua │ ├── callbacks │ │ ├── conf.lua │ │ ├── draw.lua │ │ ├── errhand.lua │ │ ├── filechanged.lua │ │ ├── focus.lua │ │ ├── keypressed.lua │ │ ├── keyreleased.lua │ │ ├── load.lua │ │ ├── log.lua │ │ ├── mirror.lua │ │ ├── mount.lua │ │ ├── mousemoved.lua │ │ ├── mousepressed.lua │ │ ├── mousereleased.lua │ │ ├── permission.lua │ │ ├── quit.lua │ │ ├── recenter.lua │ │ ├── resize.lua │ │ ├── restart.lua │ │ ├── run.lua │ │ ├── textinput.lua │ │ ├── threaderror.lua │ │ ├── update.lua │ │ ├── visible.lua │ │ └── wheelmoved.lua │ ├── data │ │ ├── AnimationProperty.lua │ │ ├── AttributeType.lua │ │ ├── Blob │ │ │ ├── getF32.lua │ │ │ ├── getF64.lua │ │ │ ├── getI16.lua │ │ │ ├── getI32.lua │ │ │ ├── getI8.lua │ │ │ ├── getName.lua │ │ │ ├── getPointer.lua │ │ │ ├── getSize.lua │ │ │ ├── getString.lua │ │ │ ├── getU16.lua │ │ │ ├── getU32.lua │ │ │ ├── getU8.lua │ │ │ ├── init.lua │ │ │ ├── setF32.lua │ │ │ ├── setF64.lua │ │ │ ├── setI16.lua │ │ │ ├── setI32.lua │ │ │ ├── setI8.lua │ │ │ ├── setU16.lua │ │ │ ├── setU32.lua │ │ │ └── setU8.lua │ │ ├── ChannelLayout.lua │ │ ├── DefaultAttribute.lua │ │ ├── Image │ │ │ ├── encode.lua │ │ │ ├── getBlob.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getFormat.lua │ │ │ ├── getHeight.lua │ │ │ ├── getPixel.lua │ │ │ ├── getPointer.lua │ │ │ ├── getWidth.lua │ │ │ ├── init.lua │ │ │ ├── mapPixel.lua │ │ │ ├── paste.lua │ │ │ └── setPixel.lua │ │ ├── ModelData │ │ │ ├── getAnimationChannelCount.lua │ │ │ ├── getAnimationCount.lua │ │ │ ├── getAnimationDuration.lua │ │ │ ├── getAnimationKeyframe.lua │ │ │ ├── getAnimationKeyframeCount.lua │ │ │ ├── getAnimationName.lua │ │ │ ├── getAnimationNode.lua │ │ │ ├── getAnimationProperty.lua │ │ │ ├── getAnimationSmoothMode.lua │ │ │ ├── getBlendShapeCount.lua │ │ │ ├── getBlendShapeName.lua │ │ │ ├── getBlob.lua │ │ │ ├── getBlobCount.lua │ │ │ ├── getBoundingBox.lua │ │ │ ├── getBoundingSphere.lua │ │ │ ├── getCenter.lua │ │ │ ├── getDepth.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getHeight.lua │ │ │ ├── getImage.lua │ │ │ ├── getImageCount.lua │ │ │ ├── getMaterial.lua │ │ │ ├── getMaterialCount.lua │ │ │ ├── getMaterialName.lua │ │ │ ├── getMeshCount.lua │ │ │ ├── getMeshDrawMode.lua │ │ │ ├── getMeshIndex.lua │ │ │ ├── getMeshIndexCount.lua │ │ │ ├── getMeshIndexFormat.lua │ │ │ ├── getMeshMaterial.lua │ │ │ ├── getMeshVertex.lua │ │ │ ├── getMeshVertexCount.lua │ │ │ ├── getMeshVertexFormat.lua │ │ │ ├── getMetadata.lua │ │ │ ├── getNodeChildren.lua │ │ │ ├── getNodeCount.lua │ │ │ ├── getNodeMeshes.lua │ │ │ ├── getNodeName.lua │ │ │ ├── getNodeOrientation.lua │ │ │ ├── getNodeParent.lua │ │ │ ├── getNodePose.lua │ │ │ ├── getNodePosition.lua │ │ │ ├── getNodeScale.lua │ │ │ ├── getNodeSkin.lua │ │ │ ├── getNodeTransform.lua │ │ │ ├── getRootNode.lua │ │ │ ├── getSkinCount.lua │ │ │ ├── getSkinInverseBindMatrix.lua │ │ │ ├── getSkinJoints.lua │ │ │ ├── getTriangleCount.lua │ │ │ ├── getTriangles.lua │ │ │ ├── getVertexCount.lua │ │ │ ├── getWidth.lua │ │ │ └── init.lua │ │ ├── ModelDrawMode.lua │ │ ├── Rasterizer │ │ │ ├── getAdvance.lua │ │ │ ├── getAscent.lua │ │ │ ├── getBearing.lua │ │ │ ├── getBoundingBox.lua │ │ │ ├── getCurves.lua │ │ │ ├── getDescent.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getFontSize.lua │ │ │ ├── getGlyphCount.lua │ │ │ ├── getHeight.lua │ │ │ ├── getKerning.lua │ │ │ ├── getLeading.lua │ │ │ ├── getWidth.lua │ │ │ ├── hasGlyphs.lua │ │ │ ├── init.lua │ │ │ └── newImage.lua │ │ ├── SampleFormat.lua │ │ ├── SmoothMode.lua │ │ ├── Sound │ │ │ ├── getBlob.lua │ │ │ ├── getByteStride.lua │ │ │ ├── getCapacity.lua │ │ │ ├── getChannelCount.lua │ │ │ ├── getChannelLayout.lua │ │ │ ├── getDuration.lua │ │ │ ├── getFormat.lua │ │ │ ├── getFrameCount.lua │ │ │ ├── getFrames.lua │ │ │ ├── getSampleCount.lua │ │ │ ├── getSampleRate.lua │ │ │ ├── init.lua │ │ │ ├── isCompressed.lua │ │ │ ├── isStream.lua │ │ │ └── setFrames.lua │ │ ├── TextureFormat.lua │ │ ├── init.lua │ │ ├── newBlob.lua │ │ ├── newImage.lua │ │ ├── newModelData.lua │ │ ├── newRasterizer.lua │ │ └── newSound.lua │ ├── enet │ │ └── init.lua │ ├── event │ │ ├── DisplayType.lua │ │ ├── KeyCode.lua │ │ ├── clear.lua │ │ ├── init.lua │ │ ├── poll.lua │ │ ├── push.lua │ │ ├── quit.lua │ │ └── restart.lua │ ├── filesystem │ │ ├── File │ │ │ ├── getMode.lua │ │ │ ├── getPath.lua │ │ │ ├── getSize.lua │ │ │ ├── init.lua │ │ │ ├── isEOF.lua │ │ │ ├── read.lua │ │ │ ├── seek.lua │ │ │ ├── tell.lua │ │ │ └── write.lua │ │ ├── FileAction.lua │ │ ├── OpenMode.lua │ │ ├── append.lua │ │ ├── createDirectory.lua │ │ ├── getAppdataDirectory.lua │ │ ├── getDirectoryItems.lua │ │ ├── getExecutablePath.lua │ │ ├── getIdentity.lua │ │ ├── getLastModified.lua │ │ ├── getRealDirectory.lua │ │ ├── getRequirePath.lua │ │ ├── getSaveDirectory.lua │ │ ├── getSize.lua │ │ ├── getSource.lua │ │ ├── getUserDirectory.lua │ │ ├── getWorkingDirectory.lua │ │ ├── init.lua │ │ ├── isDirectory.lua │ │ ├── isFile.lua │ │ ├── isFused.lua │ │ ├── load.lua │ │ ├── mount.lua │ │ ├── newBlob.lua │ │ ├── newFile.lua │ │ ├── read.lua │ │ ├── remove.lua │ │ ├── setIdentity.lua │ │ ├── setRequirePath.lua │ │ ├── unmount.lua │ │ ├── unwatch.lua │ │ ├── watch.lua │ │ └── write.lua │ ├── getVersion.lua │ ├── graphics │ │ ├── BlendAlphaMode.lua │ │ ├── BlendMode.lua │ │ ├── Buffer │ │ │ ├── clear.lua │ │ │ ├── getData.lua │ │ │ ├── getFormat.lua │ │ │ ├── getLength.lua │ │ │ ├── getPointer.lua │ │ │ ├── getSize.lua │ │ │ ├── getStride.lua │ │ │ ├── init.lua │ │ │ ├── isTemporary.lua │ │ │ ├── mapData.lua │ │ │ ├── newReadback.lua │ │ │ └── setData.lua │ │ ├── CompareMode.lua │ │ ├── CullMode.lua │ │ ├── DataLayout.lua │ │ ├── DataType.lua │ │ ├── DefaultShader.lua │ │ ├── DrawMode.lua │ │ ├── DrawStyle.lua │ │ ├── FilterMode.lua │ │ ├── Font │ │ │ ├── getAscent.lua │ │ │ ├── getDescent.lua │ │ │ ├── getHeight.lua │ │ │ ├── getKerning.lua │ │ │ ├── getLineSpacing.lua │ │ │ ├── getLines.lua │ │ │ ├── getPixelDensity.lua │ │ │ ├── getRasterizer.lua │ │ │ ├── getVertices.lua │ │ │ ├── getWidth.lua │ │ │ ├── init.lua │ │ │ ├── setLineSpacing.lua │ │ │ └── setPixelDensity.lua │ │ ├── HorizontalAlign.lua │ │ ├── Material │ │ │ ├── getProperties.lua │ │ │ └── init.lua │ │ ├── Mesh │ │ │ ├── computeBoundingBox.lua │ │ │ ├── getBoundingBox.lua │ │ │ ├── getDrawMode.lua │ │ │ ├── getDrawRange.lua │ │ │ ├── getIndexBuffer.lua │ │ │ ├── getIndices.lua │ │ │ ├── getMaterial.lua │ │ │ ├── getVertexBuffer.lua │ │ │ ├── getVertexCount.lua │ │ │ ├── getVertexFormat.lua │ │ │ ├── getVertexStride.lua │ │ │ ├── getVertices.lua │ │ │ ├── init.lua │ │ │ ├── setBoundingBox.lua │ │ │ ├── setDrawMode.lua │ │ │ ├── setDrawRange.lua │ │ │ ├── setIndexBuffer.lua │ │ │ ├── setIndices.lua │ │ │ ├── setMaterial.lua │ │ │ └── setVertices.lua │ │ ├── MeshStorage.lua │ │ ├── Model │ │ │ ├── animate.lua │ │ │ ├── clone.lua │ │ │ ├── getAnimationCount.lua │ │ │ ├── getAnimationDuration.lua │ │ │ ├── getAnimationName.lua │ │ │ ├── getBlendShapeCount.lua │ │ │ ├── getBlendShapeName.lua │ │ │ ├── getBlendShapeWeight.lua │ │ │ ├── getBoundingBox.lua │ │ │ ├── getBoundingSphere.lua │ │ │ ├── getCenter.lua │ │ │ ├── getData.lua │ │ │ ├── getDepth.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getHeight.lua │ │ │ ├── getIndexBuffer.lua │ │ │ ├── getMaterial.lua │ │ │ ├── getMaterialCount.lua │ │ │ ├── getMaterialName.lua │ │ │ ├── getMesh.lua │ │ │ ├── getMeshCount.lua │ │ │ ├── getMetadata.lua │ │ │ ├── getNodeChildren.lua │ │ │ ├── getNodeCount.lua │ │ │ ├── getNodeName.lua │ │ │ ├── getNodeOrientation.lua │ │ │ ├── getNodeParent.lua │ │ │ ├── getNodePose.lua │ │ │ ├── getNodePosition.lua │ │ │ ├── getNodeScale.lua │ │ │ ├── getNodeTransform.lua │ │ │ ├── getRootNode.lua │ │ │ ├── getTexture.lua │ │ │ ├── getTextureCount.lua │ │ │ ├── getTriangleCount.lua │ │ │ ├── getTriangles.lua │ │ │ ├── getVertexBuffer.lua │ │ │ ├── getVertexCount.lua │ │ │ ├── getWidth.lua │ │ │ ├── hasJoints.lua │ │ │ ├── init.lua │ │ │ ├── resetBlendShapes.lua │ │ │ ├── resetNodeTransforms.lua │ │ │ ├── setBlendShapeWeight.lua │ │ │ ├── setNodeOrientation.lua │ │ │ ├── setNodePose.lua │ │ │ ├── setNodePosition.lua │ │ │ ├── setNodeScale.lua │ │ │ └── setNodeTransform.lua │ │ ├── OriginType.lua │ │ ├── Pass │ │ │ ├── barrier.lua │ │ │ ├── beginTally.lua │ │ │ ├── box.lua │ │ │ ├── capsule.lua │ │ │ ├── circle.lua │ │ │ ├── compute.lua │ │ │ ├── cone.lua │ │ │ ├── cube.lua │ │ │ ├── cylinder.lua │ │ │ ├── draw.lua │ │ │ ├── fill.lua │ │ │ ├── finishTally.lua │ │ │ ├── getCanvas.lua │ │ │ ├── getClear.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getHeight.lua │ │ │ ├── getLabel.lua │ │ │ ├── getProjection.lua │ │ │ ├── getSampleCount.lua │ │ │ ├── getStats.lua │ │ │ ├── getTallyBuffer.lua │ │ │ ├── getTarget.lua │ │ │ ├── getType.lua │ │ │ ├── getViewCount.lua │ │ │ ├── getViewPose.lua │ │ │ ├── getWidth.lua │ │ │ ├── init.lua │ │ │ ├── line.lua │ │ │ ├── mesh.lua │ │ │ ├── origin.lua │ │ │ ├── plane.lua │ │ │ ├── points.lua │ │ │ ├── polygon.lua │ │ │ ├── pop.lua │ │ │ ├── push.lua │ │ │ ├── reset.lua │ │ │ ├── rotate.lua │ │ │ ├── roundrect.lua │ │ │ ├── scale.lua │ │ │ ├── send.lua │ │ │ ├── setAlphaToCoverage.lua │ │ │ ├── setBlendMode.lua │ │ │ ├── setCanvas.lua │ │ │ ├── setClear.lua │ │ │ ├── setColor.lua │ │ │ ├── setColorWrite.lua │ │ │ ├── setCullMode.lua │ │ │ ├── setDepthClamp.lua │ │ │ ├── setDepthOffset.lua │ │ │ ├── setDepthTest.lua │ │ │ ├── setDepthWrite.lua │ │ │ ├── setFaceCull.lua │ │ │ ├── setFont.lua │ │ │ ├── setMaterial.lua │ │ │ ├── setMeshMode.lua │ │ │ ├── setProjection.lua │ │ │ ├── setSampler.lua │ │ │ ├── setScissor.lua │ │ │ ├── setShader.lua │ │ │ ├── setStencilTest.lua │ │ │ ├── setStencilWrite.lua │ │ │ ├── setTallyBuffer.lua │ │ │ ├── setViewCull.lua │ │ │ ├── setViewPose.lua │ │ │ ├── setViewport.lua │ │ │ ├── setWinding.lua │ │ │ ├── setWireframe.lua │ │ │ ├── skybox.lua │ │ │ ├── sphere.lua │ │ │ ├── text.lua │ │ │ ├── torus.lua │ │ │ ├── transform.lua │ │ │ └── translate.lua │ │ ├── PassType.lua │ │ ├── Readback │ │ │ ├── getBlob.lua │ │ │ ├── getData.lua │ │ │ ├── getImage.lua │ │ │ ├── init.lua │ │ │ ├── isComplete.lua │ │ │ └── wait.lua │ │ ├── Sampler │ │ │ ├── getAnisotropy.lua │ │ │ ├── getCompareMode.lua │ │ │ ├── getFilter.lua │ │ │ ├── getMipmapRange.lua │ │ │ ├── getWrap.lua │ │ │ └── init.lua │ │ ├── Shader │ │ │ ├── clone.lua │ │ │ ├── getBufferFormat.lua │ │ │ ├── getLabel.lua │ │ │ ├── getType.lua │ │ │ ├── getWorkgroupSize.lua │ │ │ ├── hasAttribute.lua │ │ │ ├── hasStage.lua │ │ │ ├── hasVariable.lua │ │ │ └── init.lua │ │ ├── ShaderStage.lua │ │ ├── ShaderType.lua │ │ ├── StackType.lua │ │ ├── StencilAction.lua │ │ ├── Texture │ │ │ ├── clear.lua │ │ │ ├── generateMipmaps.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getFormat.lua │ │ │ ├── getHeight.lua │ │ │ ├── getLabel.lua │ │ │ ├── getLayerCount.lua │ │ │ ├── getMipmapCount.lua │ │ │ ├── getPixels.lua │ │ │ ├── getSampleCount.lua │ │ │ ├── getSampler.lua │ │ │ ├── getType.lua │ │ │ ├── getWidth.lua │ │ │ ├── hasUsage.lua │ │ │ ├── init.lua │ │ │ ├── newReadback.lua │ │ │ ├── setPixels.lua │ │ │ └── setSampler.lua │ │ ├── TextureFeature.lua │ │ ├── TextureType.lua │ │ ├── TextureUsage.lua │ │ ├── VerticalAlign.lua │ │ ├── Winding.lua │ │ ├── WrapMode.lua │ │ ├── compileShader.lua │ │ ├── getBackgroundColor.lua │ │ ├── getBuffer.lua │ │ ├── getDefaultFont.lua │ │ ├── getDevice.lua │ │ ├── getFeatures.lua │ │ ├── getLimits.lua │ │ ├── getPass.lua │ │ ├── getWindowPass.lua │ │ ├── init.lua │ │ ├── isFormatSupported.lua │ │ ├── isHDR.lua │ │ ├── isTimingEnabled.lua │ │ ├── newBuffer.lua │ │ ├── newFont.lua │ │ ├── newMaterial.lua │ │ ├── newMesh.lua │ │ ├── newModel.lua │ │ ├── newPass.lua │ │ ├── newSampler.lua │ │ ├── newShader.lua │ │ ├── newTexture.lua │ │ ├── newTextureView.lua │ │ ├── present.lua │ │ ├── setBackgroundColor.lua │ │ ├── setTimingEnabled.lua │ │ ├── submit.lua │ │ └── wait.lua │ ├── headset │ │ ├── Device.lua │ │ ├── DeviceAxis.lua │ │ ├── DeviceButton.lua │ │ ├── FoveationLevel.lua │ │ ├── HeadsetDriver.lua │ │ ├── HeadsetOrigin.lua │ │ ├── Layer │ │ │ ├── getColor.lua │ │ │ ├── getCurve.lua │ │ │ ├── getDimensions.lua │ │ │ ├── getOrientation.lua │ │ │ ├── getPass.lua │ │ │ ├── getPose.lua │ │ │ ├── getPosition.lua │ │ │ ├── getTexture.lua │ │ │ ├── getViewport.lua │ │ │ ├── init.lua │ │ │ ├── setColor.lua │ │ │ ├── setCurve.lua │ │ │ ├── setDimensions.lua │ │ │ ├── setOrientation.lua │ │ │ ├── setPose.lua │ │ │ ├── setPosition.lua │ │ │ └── setViewport.lua │ │ ├── PassthroughMode.lua │ │ ├── animate.lua │ │ ├── getAngularVelocity.lua │ │ ├── getAxis.lua │ │ ├── getBoundsDepth.lua │ │ ├── getBoundsDimensions.lua │ │ ├── getBoundsGeometry.lua │ │ ├── getBoundsWidth.lua │ │ ├── getClipDistance.lua │ │ ├── getDeltaTime.lua │ │ ├── getDirection.lua │ │ ├── getDisplayDimensions.lua │ │ ├── getDisplayFrequencies.lua │ │ ├── getDisplayFrequency.lua │ │ ├── getDisplayHeight.lua │ │ ├── getDisplayWidth.lua │ │ ├── getDriver.lua │ │ ├── getFeatures.lua │ │ ├── getFoveation.lua │ │ ├── getHandles.lua │ │ ├── getHands.lua │ │ ├── getLayers.lua │ │ ├── getName.lua │ │ ├── getOrientation.lua │ │ ├── getOriginType.lua │ │ ├── getPass.lua │ │ ├── getPassthrough.lua │ │ ├── getPassthroughModes.lua │ │ ├── getPose.lua │ │ ├── getPosition.lua │ │ ├── getRefreshRate.lua │ │ ├── getRefreshRates.lua │ │ ├── getSkeleton.lua │ │ ├── getTexture.lua │ │ ├── getTime.lua │ │ ├── getVelocity.lua │ │ ├── getViewAngles.lua │ │ ├── getViewCount.lua │ │ ├── getViewPose.lua │ │ ├── init.lua │ │ ├── isActive.lua │ │ ├── isDown.lua │ │ ├── isFocused.lua │ │ ├── isMounted.lua │ │ ├── isSeated.lua │ │ ├── isTouched.lua │ │ ├── isTracked.lua │ │ ├── isVisible.lua │ │ ├── newLayer.lua │ │ ├── newModel.lua │ │ ├── setBackground.lua │ │ ├── setClipDistance.lua │ │ ├── setDisplayFrequency.lua │ │ ├── setFoveation.lua │ │ ├── setLayers.lua │ │ ├── setPassthrough.lua │ │ ├── setRefreshRate.lua │ │ ├── start.lua │ │ ├── stop.lua │ │ ├── stopVibration.lua │ │ ├── submit.lua │ │ ├── update.lua │ │ ├── vibrate.lua │ │ ├── wasPressed.lua │ │ └── wasReleased.lua │ ├── http │ │ └── init.lua │ ├── init.lua │ ├── math │ │ ├── Curve │ │ │ ├── addPoint.lua │ │ │ ├── evaluate.lua │ │ │ ├── getPoint.lua │ │ │ ├── getPointCount.lua │ │ │ ├── getTangent.lua │ │ │ ├── init.lua │ │ │ ├── removePoint.lua │ │ │ ├── render.lua │ │ │ ├── setPoint.lua │ │ │ └── slice.lua │ │ ├── Mat4 │ │ │ ├── equals.lua │ │ │ ├── fov.lua │ │ │ ├── getOrientation.lua │ │ │ ├── getPose.lua │ │ │ ├── getPosition.lua │ │ │ ├── getScale.lua │ │ │ ├── identity.lua │ │ │ ├── init.lua │ │ │ ├── invert.lua │ │ │ ├── lookAt.lua │ │ │ ├── mul.lua │ │ │ ├── orthographic.lua │ │ │ ├── perspective.lua │ │ │ ├── reflect.lua │ │ │ ├── rotate.lua │ │ │ ├── scale.lua │ │ │ ├── set.lua │ │ │ ├── target.lua │ │ │ ├── translate.lua │ │ │ ├── transpose.lua │ │ │ └── unpack.lua │ │ ├── Quat │ │ │ ├── conjugate.lua │ │ │ ├── direction.lua │ │ │ ├── equals.lua │ │ │ ├── getEuler.lua │ │ │ ├── init.lua │ │ │ ├── length.lua │ │ │ ├── mul.lua │ │ │ ├── normalize.lua │ │ │ ├── set.lua │ │ │ ├── setEuler.lua │ │ │ ├── slerp.lua │ │ │ └── unpack.lua │ │ ├── RandomGenerator │ │ │ ├── getSeed.lua │ │ │ ├── getState.lua │ │ │ ├── init.lua │ │ │ ├── random.lua │ │ │ ├── randomNormal.lua │ │ │ ├── setSeed.lua │ │ │ └── setState.lua │ │ ├── Vec2 │ │ │ ├── add.lua │ │ │ ├── angle.lua │ │ │ ├── distance.lua │ │ │ ├── div.lua │ │ │ ├── dot.lua │ │ │ ├── equals.lua │ │ │ ├── init.lua │ │ │ ├── length.lua │ │ │ ├── lerp.lua │ │ │ ├── mul.lua │ │ │ ├── normalize.lua │ │ │ ├── set.lua │ │ │ ├── sub.lua │ │ │ └── unpack.lua │ │ ├── Vec3 │ │ │ ├── add.lua │ │ │ ├── angle.lua │ │ │ ├── cross.lua │ │ │ ├── distance.lua │ │ │ ├── div.lua │ │ │ ├── dot.lua │ │ │ ├── equals.lua │ │ │ ├── init.lua │ │ │ ├── length.lua │ │ │ ├── lerp.lua │ │ │ ├── mul.lua │ │ │ ├── normalize.lua │ │ │ ├── rotate.lua │ │ │ ├── set.lua │ │ │ ├── sub.lua │ │ │ ├── transform.lua │ │ │ └── unpack.lua │ │ ├── Vec4 │ │ │ ├── add.lua │ │ │ ├── angle.lua │ │ │ ├── distance.lua │ │ │ ├── div.lua │ │ │ ├── dot.lua │ │ │ ├── equals.lua │ │ │ ├── init.lua │ │ │ ├── length.lua │ │ │ ├── lerp.lua │ │ │ ├── mul.lua │ │ │ ├── normalize.lua │ │ │ ├── set.lua │ │ │ ├── sub.lua │ │ │ ├── transform.lua │ │ │ └── unpack.lua │ │ ├── Vectors │ │ │ └── init.lua │ │ ├── drain.lua │ │ ├── gammaToLinear.lua │ │ ├── getRandomSeed.lua │ │ ├── init.lua │ │ ├── linearToGamma.lua │ │ ├── mat4.lua │ │ ├── newCurve.lua │ │ ├── newMat4.lua │ │ ├── newQuat.lua │ │ ├── newRandomGenerator.lua │ │ ├── newVec2.lua │ │ ├── newVec3.lua │ │ ├── newVec4.lua │ │ ├── noise.lua │ │ ├── quat.lua │ │ ├── random.lua │ │ ├── randomNormal.lua │ │ ├── setRandomSeed.lua │ │ ├── vec2.lua │ │ ├── vec3.lua │ │ └── vec4.lua │ ├── physics │ │ ├── BallJoint │ │ │ └── init.lua │ │ ├── BoxShape │ │ │ ├── getDimensions.lua │ │ │ ├── init.lua │ │ │ └── setDimensions.lua │ │ ├── CapsuleShape │ │ │ ├── getLength.lua │ │ │ ├── getRadius.lua │ │ │ ├── init.lua │ │ │ ├── setLength.lua │ │ │ └── setRadius.lua │ │ ├── Collider │ │ │ ├── addShape.lua │ │ │ ├── applyAngularImpulse.lua │ │ │ ├── applyForce.lua │ │ │ ├── applyLinearImpulse.lua │ │ │ ├── applyTorque.lua │ │ │ ├── destroy.lua │ │ │ ├── getAABB.lua │ │ │ ├── getAngularDamping.lua │ │ │ ├── getAngularVelocity.lua │ │ │ ├── getAutomaticMass.lua │ │ │ ├── getCenterOfMass.lua │ │ │ ├── getDegreesOfFreedom.lua │ │ │ ├── getFriction.lua │ │ │ ├── getGravityScale.lua │ │ │ ├── getInertia.lua │ │ │ ├── getJoints.lua │ │ │ ├── getLinearDamping.lua │ │ │ ├── getLinearVelocity.lua │ │ │ ├── getLinearVelocityFromLocalPoint.lua │ │ │ ├── getLinearVelocityFromWorldPoint.lua │ │ │ ├── getLocalPoint.lua │ │ │ ├── getLocalVector.lua │ │ │ ├── getMass.lua │ │ │ ├── getOrientation.lua │ │ │ ├── getPose.lua │ │ │ ├── getPosition.lua │ │ │ ├── getRestitution.lua │ │ │ ├── getShape.lua │ │ │ ├── getShapes.lua │ │ │ ├── getTag.lua │ │ │ ├── getUserData.lua │ │ │ ├── getWorld.lua │ │ │ ├── getWorldPoint.lua │ │ │ ├── getWorldVector.lua │ │ │ ├── init.lua │ │ │ ├── isAwake.lua │ │ │ ├── isContinuous.lua │ │ │ ├── isDestroyed.lua │ │ │ ├── isEnabled.lua │ │ │ ├── isGravityIgnored.lua │ │ │ ├── isKinematic.lua │ │ │ ├── isSensor.lua │ │ │ ├── isSleepingAllowed.lua │ │ │ ├── moveKinematic.lua │ │ │ ├── removeShape.lua │ │ │ ├── resetMassData.lua │ │ │ ├── setAngularDamping.lua │ │ │ ├── setAngularVelocity.lua │ │ │ ├── setAutomaticMass.lua │ │ │ ├── setAwake.lua │ │ │ ├── setCenterOfMass.lua │ │ │ ├── setContinuous.lua │ │ │ ├── setDegreesOfFreedom.lua │ │ │ ├── setEnabled.lua │ │ │ ├── setFriction.lua │ │ │ ├── setGravityIgnored.lua │ │ │ ├── setGravityScale.lua │ │ │ ├── setInertia.lua │ │ │ ├── setKinematic.lua │ │ │ ├── setLinearDamping.lua │ │ │ ├── setLinearVelocity.lua │ │ │ ├── setMass.lua │ │ │ ├── setOrientation.lua │ │ │ ├── setPose.lua │ │ │ ├── setPosition.lua │ │ │ ├── setRestitution.lua │ │ │ ├── setSensor.lua │ │ │ ├── setSleepingAllowed.lua │ │ │ ├── setTag.lua │ │ │ └── setUserData.lua │ │ ├── ConeJoint │ │ │ ├── getAxis.lua │ │ │ ├── getLimit.lua │ │ │ ├── init.lua │ │ │ └── setLimit.lua │ │ ├── Contact │ │ │ ├── getColliders.lua │ │ │ ├── getFriction.lua │ │ │ ├── getNormal.lua │ │ │ ├── getOverlap.lua │ │ │ ├── getPoints.lua │ │ │ ├── getRestitution.lua │ │ │ ├── getShapes.lua │ │ │ ├── getSurfaceVelocity.lua │ │ │ ├── init.lua │ │ │ ├── isEnabled.lua │ │ │ ├── setEnabled.lua │ │ │ ├── setFriction.lua │ │ │ ├── setRestitution.lua │ │ │ └── setSurfaceVelocity.lua │ │ ├── ConvexShape │ │ │ ├── getFace.lua │ │ │ ├── getFaceCount.lua │ │ │ ├── getPoint.lua │ │ │ ├── getPointCount.lua │ │ │ ├── getScale.lua │ │ │ └── init.lua │ │ ├── CylinderShape │ │ │ ├── getLength.lua │ │ │ ├── getRadius.lua │ │ │ ├── init.lua │ │ │ ├── setLength.lua │ │ │ └── setRadius.lua │ │ ├── DistanceJoint │ │ │ ├── getLimits.lua │ │ │ ├── getSpring.lua │ │ │ ├── init.lua │ │ │ ├── setLimits.lua │ │ │ └── setSpring.lua │ │ ├── HingeJoint │ │ │ ├── getAngle.lua │ │ │ ├── getAxis.lua │ │ │ ├── getFriction.lua │ │ │ ├── getLimits.lua │ │ │ ├── getMaxMotorTorque.lua │ │ │ ├── getMotorMode.lua │ │ │ ├── getMotorSpring.lua │ │ │ ├── getMotorTarget.lua │ │ │ ├── getMotorTorque.lua │ │ │ ├── getSpring.lua │ │ │ ├── init.lua │ │ │ ├── setFriction.lua │ │ │ ├── setLimits.lua │ │ │ ├── setMaxMotorTorque.lua │ │ │ ├── setMotorMode.lua │ │ │ ├── setMotorSpring.lua │ │ │ ├── setMotorTarget.lua │ │ │ └── setSpring.lua │ │ ├── Joint │ │ │ ├── destroy.lua │ │ │ ├── getAnchors.lua │ │ │ ├── getColliders.lua │ │ │ ├── getForce.lua │ │ │ ├── getPriority.lua │ │ │ ├── getTorque.lua │ │ │ ├── getType.lua │ │ │ ├── getUserData.lua │ │ │ ├── init.lua │ │ │ ├── isDestroyed.lua │ │ │ ├── isEnabled.lua │ │ │ ├── setEnabled.lua │ │ │ ├── setPriority.lua │ │ │ └── setUserData.lua │ │ ├── JointType.lua │ │ ├── MeshShape │ │ │ ├── getScale.lua │ │ │ └── init.lua │ │ ├── MotorMode.lua │ │ ├── Shape │ │ │ ├── containsPoint.lua │ │ │ ├── destroy.lua │ │ │ ├── getAABB.lua │ │ │ ├── getCenterOfMass.lua │ │ │ ├── getCollider.lua │ │ │ ├── getDensity.lua │ │ │ ├── getInertia.lua │ │ │ ├── getMass.lua │ │ │ ├── getOffset.lua │ │ │ ├── getOrientation.lua │ │ │ ├── getPose.lua │ │ │ ├── getPosition.lua │ │ │ ├── getType.lua │ │ │ ├── getUserData.lua │ │ │ ├── getVolume.lua │ │ │ ├── init.lua │ │ │ ├── isDestroyed.lua │ │ │ ├── raycast.lua │ │ │ ├── setDensity.lua │ │ │ ├── setOffset.lua │ │ │ └── setUserData.lua │ │ ├── ShapeType.lua │ │ ├── SliderJoint │ │ │ ├── getAxis.lua │ │ │ ├── getFriction.lua │ │ │ ├── getLimits.lua │ │ │ ├── getMaxMotorForce.lua │ │ │ ├── getMotorForce.lua │ │ │ ├── getMotorMode.lua │ │ │ ├── getMotorSpring.lua │ │ │ ├── getMotorTarget.lua │ │ │ ├── getPosition.lua │ │ │ ├── getSpring.lua │ │ │ ├── init.lua │ │ │ ├── setFriction.lua │ │ │ ├── setLimits.lua │ │ │ ├── setMaxMotorForce.lua │ │ │ ├── setMotorMode.lua │ │ │ ├── setMotorSpring.lua │ │ │ ├── setMotorTarget.lua │ │ │ └── setSpring.lua │ │ ├── SphereShape │ │ │ ├── getRadius.lua │ │ │ ├── init.lua │ │ │ └── setRadius.lua │ │ ├── TerrainShape │ │ │ └── init.lua │ │ ├── WeldJoint │ │ │ └── init.lua │ │ ├── World │ │ │ ├── destroy.lua │ │ │ ├── disableCollisionBetween.lua │ │ │ ├── enableCollisionBetween.lua │ │ │ ├── getAngularDamping.lua │ │ │ ├── getCallbacks.lua │ │ │ ├── getColliderCount.lua │ │ │ ├── getColliders.lua │ │ │ ├── getGravity.lua │ │ │ ├── getJointCount.lua │ │ │ ├── getJoints.lua │ │ │ ├── getLinearDamping.lua │ │ │ ├── getResponseTime.lua │ │ │ ├── getStepCount.lua │ │ │ ├── getTags.lua │ │ │ ├── getTightness.lua │ │ │ ├── init.lua │ │ │ ├── interpolate.lua │ │ │ ├── isCollisionEnabledBetween.lua │ │ │ ├── isDestroyed.lua │ │ │ ├── isSleepingAllowed.lua │ │ │ ├── newBoxCollider.lua │ │ │ ├── newCapsuleCollider.lua │ │ │ ├── newCollider.lua │ │ │ ├── newConvexCollider.lua │ │ │ ├── newCylinderCollider.lua │ │ │ ├── newMeshCollider.lua │ │ │ ├── newSphereCollider.lua │ │ │ ├── newTerrainCollider.lua │ │ │ ├── overlapShape.lua │ │ │ ├── queryBox.lua │ │ │ ├── querySphere.lua │ │ │ ├── raycast.lua │ │ │ ├── setAngularDamping.lua │ │ │ ├── setCallbacks.lua │ │ │ ├── setGravity.lua │ │ │ ├── setLinearDamping.lua │ │ │ ├── setResponseTime.lua │ │ │ ├── setSleepingAllowed.lua │ │ │ ├── setStepCount.lua │ │ │ ├── setTightness.lua │ │ │ ├── shapecast.lua │ │ │ └── update.lua │ │ ├── init.lua │ │ ├── newBallJoint.lua │ │ ├── newBoxShape.lua │ │ ├── newCapsuleShape.lua │ │ ├── newConeJoint.lua │ │ ├── newConvexShape.lua │ │ ├── newCylinderShape.lua │ │ ├── newDistanceJoint.lua │ │ ├── newHingeJoint.lua │ │ ├── newMeshShape.lua │ │ ├── newSliderJoint.lua │ │ ├── newSphereShape.lua │ │ ├── newTerrainShape.lua │ │ ├── newWeldJoint.lua │ │ └── newWorld.lua │ ├── system │ │ ├── Permission.lua │ │ ├── getClipboardText.lua │ │ ├── getCoreCount.lua │ │ ├── getMousePosition.lua │ │ ├── getMouseX.lua │ │ ├── getMouseY.lua │ │ ├── getOS.lua │ │ ├── getWindowDensity.lua │ │ ├── getWindowDimensions.lua │ │ ├── getWindowHeight.lua │ │ ├── getWindowWidth.lua │ │ ├── hasKeyRepeat.lua │ │ ├── init.lua │ │ ├── isKeyDown.lua │ │ ├── isMouseDown.lua │ │ ├── isWindowFocused.lua │ │ ├── isWindowOpen.lua │ │ ├── isWindowVisible.lua │ │ ├── openWindow.lua │ │ ├── pollEvents.lua │ │ ├── requestPermission.lua │ │ ├── setClipboardText.lua │ │ ├── setKeyRepeat.lua │ │ ├── wasKeyPressed.lua │ │ ├── wasKeyReleased.lua │ │ ├── wasMousePressed.lua │ │ └── wasMouseReleased.lua │ ├── thread │ │ ├── Channel │ │ │ ├── clear.lua │ │ │ ├── getCount.lua │ │ │ ├── hasRead.lua │ │ │ ├── init.lua │ │ │ ├── peek.lua │ │ │ ├── pop.lua │ │ │ └── push.lua │ │ ├── Thread │ │ │ ├── getError.lua │ │ │ ├── init.lua │ │ │ ├── isRunning.lua │ │ │ ├── start.lua │ │ │ └── wait.lua │ │ ├── getChannel.lua │ │ ├── init.lua │ │ ├── newChannel.lua │ │ └── newThread.lua │ ├── timer │ │ ├── getAverageDelta.lua │ │ ├── getDelta.lua │ │ ├── getFPS.lua │ │ ├── getTime.lua │ │ ├── init.lua │ │ ├── sleep.lua │ │ └── step.lua │ └── utf8 │ │ └── init.lua ├── main.lua └── serpent.lua ├── examples ├── Animation │ ├── 2_Bone_IK │ │ └── main.lua │ └── Playback │ │ ├── main.lua │ │ └── scytha │ │ ├── scene.bin │ │ ├── scene.gltf │ │ └── textures │ │ ├── mat1.002mat_baseColor.png │ │ ├── mat2.005mat_baseColor.png │ │ └── mat3.001mat_baseColor.png ├── Audio │ ├── Directivity │ │ ├── main.lua │ │ └── sine.wav │ ├── Mute │ │ ├── main.lua │ │ └── sine.wav │ ├── Playback │ │ ├── main.lua │ │ └── sine.wav │ ├── Sine_Wave_Generator │ │ └── main.lua │ └── Spatialization │ │ ├── main.lua │ │ └── sine.wav ├── Debugging │ ├── Raw_Input │ │ └── main.lua │ └── Tally │ │ └── main.lua ├── Effects │ ├── Billboards │ │ └── main.lua │ ├── Blur │ │ ├── eye-chart-test-vintage-cc0.jpg │ │ └── main.lua │ ├── Clipping │ │ └── main.lua │ ├── Cubemap_Generate │ │ └── main.lua │ ├── Cubemap_Texturing │ │ ├── main.lua │ │ ├── negx.jpg │ │ ├── negy.jpg │ │ ├── negz.jpg │ │ ├── posx.jpg │ │ ├── posy.jpg │ │ └── posz.jpg │ ├── Stencil │ │ ├── conf.lua │ │ └── main.lua │ └── Stereo_Image │ │ ├── main.lua │ │ └── sbs_left_right.png ├── Environment │ ├── Grid │ │ └── main.lua │ ├── Grid_(Smooth) │ │ └── main.lua │ ├── Mirror │ │ ├── conf.lua │ │ └── main.lua │ ├── Skybox │ │ ├── main.lua │ │ ├── negx.jpg │ │ ├── negy.jpg │ │ ├── negz.jpg │ │ ├── posx.jpg │ │ ├── posy.jpg │ │ └── posz.jpg │ ├── Terrain_-_Heightmap │ │ ├── heightmap.png │ │ └── main.lua │ ├── Terrain_-_Procedural │ │ └── main.lua │ └── Triplanar_Mapping │ │ ├── dirt.png │ │ ├── grass.png │ │ ├── main.lua │ │ └── rock.png ├── Flatscreen │ ├── 2D_Button │ │ ├── conf.lua │ │ └── main.lua │ ├── FPS_Controls │ │ ├── conf.lua │ │ ├── lovr-mouse.lua │ │ └── main.lua │ ├── Spectator_Camera │ │ └── main.lua │ └── Window_HUD │ │ ├── main.lua │ │ └── shader.lua ├── Interaction │ ├── Controller_Models │ │ └── main.lua │ ├── Custom_Hand_Rig │ │ ├── left.glb │ │ ├── main.lua │ │ └── right.glb │ ├── Dragging │ │ └── main.lua │ ├── Dragging_with_Rotation │ │ └── main.lua │ ├── Hand_Gestures │ │ └── main.lua │ ├── Hand_Tracking │ │ └── main.lua │ ├── Physics_Pointer │ │ └── main.lua │ ├── Pointer │ │ └── main.lua │ └── Pointer_UI │ │ └── main.lua ├── Intro │ ├── 360_Photo │ │ ├── equirectangular.jpg │ │ └── main.lua │ ├── 3D_Model │ │ ├── main.lua │ │ └── suzanne.obj │ ├── Custom_Mesh │ │ └── main.lua │ ├── Hello_World │ │ └── main.lua │ ├── Shapes │ │ └── main.lua │ ├── Spinning_Cube │ │ └── main.lua │ ├── Thread │ │ └── main.lua │ └── Tracked_Hands │ │ └── main.lua ├── Lighting │ ├── Cel_Shading │ │ └── main.lua │ ├── Circular_Shadows │ │ └── main.lua │ ├── PBR_Materials │ │ ├── DamagedHelmet.glb │ │ ├── ibl.ktx │ │ ├── main.lua │ │ └── skybox │ │ │ ├── nx.png │ │ │ ├── ny.png │ │ │ ├── nz.png │ │ │ ├── px.png │ │ │ ├── py.png │ │ │ └── pz.png │ └── Shadows │ │ └── main.lua ├── Locomotion │ ├── Basic_Thumbsticks │ │ └── main.lua │ ├── Space_Stretch │ │ └── main.lua │ ├── Teleportation_Colliders │ │ └── main.lua │ ├── Teleportation_Flat │ │ └── main.lua │ └── Walking_In_Place │ │ └── main.lua ├── Optimization │ ├── Instancing │ │ ├── main.lua │ │ └── monkey.obj │ ├── Instancing_-_Blob │ │ ├── main.lua │ │ └── monkey.obj │ └── Instancing_-_Compute │ │ ├── main.lua │ │ └── monkey.obj ├── Physics │ ├── Boxes │ │ └── main.lua │ ├── Hand_Physics │ │ └── main.lua │ ├── Newtons_Cradle │ │ └── main.lua │ ├── Saloon_Door │ │ └── main.lua │ ├── Terrain │ │ └── main.lua │ ├── Wrecking_Ball │ │ └── main.lua │ └── Zip_Line │ │ └── main.lua └── init.lua ├── guides ├── Callbacks_and_Modules.md ├── Compiling.md ├── Contributing.md ├── Distribution.md ├── FAQ.md ├── Getting_Started.md ├── Getting_Started_(Quest).md ├── Libraries.md ├── Plugins.md ├── Scripting_Languages.md ├── Shaders.md ├── Simple_Lighting.md ├── Standard_Shader.md ├── VS_Code_Setup.md ├── init.lua ├── v0.17.0.md ├── v0.18.0.md └── v0.19.0.md └── showcase ├── Break ├── board.lua ├── break-buzzer.ogg ├── break-bwomp-song-1-split-0.ogg ├── break-bwomp-song-1-split-1.ogg ├── break-bwomp-song-1-split-2.ogg ├── break-bwomp-song-1-split-3.ogg ├── break-bwomp-song-1-split-4.ogg ├── break-bwomp-song-1-split-5.ogg ├── break-countdown.ogg ├── init.lua ├── led.lua ├── main.lua └── shader.lua └── init.lua /api/conf.lua: -------------------------------------------------------------------------------- 1 | function lovr.conf(t) 2 | t.audio.start = false 3 | t.modules.audio = not os.getenv('CI') 4 | t.modules.graphics = not os.getenv('CI') 5 | t.window = nil 6 | end 7 | -------------------------------------------------------------------------------- /api/lovr/Object/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'The base object.', 3 | description = 'The superclass of all LÖVR objects. All objects have these methods.', 4 | notes = 'Note that the functions here don\'t apply to any vector objects, see `Vectors`.' 5 | } 6 | -------------------------------------------------------------------------------- /api/lovr/Object/type.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the type name of the object.', 3 | description = 'Returns the name of the object\'s type as a string.', 4 | arguments = {}, 5 | returns = { 6 | type = { 7 | type = 'string', 8 | description = 'The type of the object.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'type' } 15 | } 16 | }, 17 | example = [[ 18 | function isTexture(obj) 19 | return type(obj) == 'userdata' and obj:type() == 'Texture' 20 | end 21 | ]] 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/audio/AudioType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different types of audio devices', 3 | description = [[ 4 | When referencing audio devices, this indicates whether it's the playback or capture device. 5 | ]], 6 | values = { 7 | { 8 | name = 'playback', 9 | description = 'The playback device (speakers, headphones).' 10 | }, 11 | { 12 | name = 'capture', 13 | description = 'The capture device (microphone).' 14 | } 15 | }, 16 | related = { 17 | 'lovr.audio.getDevices', 18 | 'lovr.audio.setDevice', 19 | 'lovr.audio.start', 20 | 'lovr.audio.stop', 21 | 'lovr.audio.isStarted' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/getDuration.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Get the duration of the Source.', 4 | description = 'Returns the duration of the Source.', 5 | arguments = { 6 | unit = { 7 | type = 'TimeUnit', 8 | default = [['seconds']], 9 | description = 'The unit to return.' 10 | } 11 | }, 12 | returns = { 13 | duration = { 14 | type = 'number', 15 | description = 'The duration of the Source.' 16 | } 17 | }, 18 | variants = { 19 | { 20 | arguments = { 'unit' }, 21 | returns = { 'duration' } 22 | } 23 | }, 24 | related = { 25 | 'Sound:getDuration' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/getPitch.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Get the pitch of the Source.', 4 | description = 'Returns the pitch of the Source.', 5 | arguments = {}, 6 | returns = { 7 | pitch = { 8 | type = 'number', 9 | description = 'The pitch.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'pitch' } 16 | } 17 | }, 18 | notes = [[ 19 | The default pitch is 1. Every doubling/halving of the pitch will raise/lower the pitch by one 20 | octave. Changing the pitch also changes the playback speed. 21 | ]] 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/getSound.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourceUtility', 3 | summary = 'Get the Sound object backing the Source.', 4 | description = [[ 5 | Returns the `Sound` object backing the Source. Multiple Sources can share one Sound, allowing 6 | its data to only be loaded once. An easy way to do this sharing is by using `Source:clone`. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | sound = { 11 | type = 'Sound', 12 | description = 'The Sound object.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'sound' } 19 | } 20 | }, 21 | related = { 22 | 'Source:clone', 23 | 'lovr.audio.newSource' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/getVolume.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Get the volume of the Source.', 4 | description = 'Returns the current volume factor for the Source.', 5 | arguments = { 6 | units = { 7 | type = 'VolumeUnit', 8 | default = [['linear']], 9 | description = 'The units to return (linear or db).' 10 | } 11 | }, 12 | returns = { 13 | volume = { 14 | type = 'number', 15 | description = 'The volume of the Source.' 16 | } 17 | }, 18 | variants = { 19 | { 20 | arguments = { 'units' }, 21 | returns = { 'volume' } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/isLooping.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Check if the Source is looping.', 4 | description = 'Returns whether or not the Source will loop when it finishes.', 5 | arguments = {}, 6 | returns = { 7 | looping = { 8 | type = 'boolean', 9 | description = 'Whether or not the Source is looping.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'looping' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/isPlaying.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Check if the Source is playing.', 4 | description = 'Returns whether or not the Source is playing.', 5 | arguments = {}, 6 | returns = { 7 | playing = { 8 | type = 'boolean', 9 | description = 'Whether the Source is playing.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'playing' } 16 | } 17 | }, 18 | related = { 19 | 'Source:play', 20 | 'Source:pause', 21 | 'Source:stop' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/isSpatial.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourceEffects', 3 | summary = 'Check if the Source is spatial.', 4 | description = [[ 5 | Returns whether the Source was created with the `spatial` flag. Non-spatial sources are routed 6 | directly to the speakers and can not use effects. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | spatial = { 11 | type = 'boolean', 12 | description = 'Whether the source is spatial.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'spatial' } 19 | } 20 | }, 21 | related = { 22 | 'Source:isEffectEnabled', 23 | 'Source:setEffectEnabled' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/pause.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Pause the Source.', 4 | description = [[ 5 | Pauses the source. It can be resumed with `Source:resume` or `Source:play`. If a paused source 6 | is rewound, it will remain paused. 7 | ]], 8 | arguments = {}, 9 | returns = {}, 10 | variants = { 11 | { 12 | arguments = {}, 13 | returns = {} 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/play.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Play the Source.', 4 | description = 'Plays the Source. This doesn\'t do anything if the Source is already playing.', 5 | arguments = {}, 6 | returns = { 7 | success = { 8 | type = 'boolean', 9 | description = 'Whether the Source successfully started playing.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'success' } 16 | } 17 | }, 18 | notes = [[ 19 | There is a maximum of 64 Sources that can be playing at once. If 64 Sources are already 20 | playing, this function will return `false`. 21 | ]] 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/seek.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Set the playback position of the Source.', 4 | description = 'Seeks the Source to the specified position.', 5 | arguments = { 6 | position = { 7 | type = 'number', 8 | description = 'The position to seek to.' 9 | }, 10 | unit = { 11 | type = 'TimeUnit', 12 | default = [['seconds']], 13 | description = 'The units for the seek position.' 14 | } 15 | }, 16 | returns = {}, 17 | variants = { 18 | { 19 | arguments = { 'position', 'unit' }, 20 | returns = {} 21 | } 22 | }, 23 | notes = 'Seeking a Source backed by a stream `Sound` has no meaningful effect.' 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/setLooping.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Set whether or not the Source loops.', 4 | description = 'Sets whether or not the Source loops.', 5 | arguments = { 6 | loop = { 7 | type = 'boolean', 8 | description = 'Whether or not the Source will loop.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'loop' }, 15 | returns = {} 16 | } 17 | }, 18 | notes = 'Attempting to loop a Source backed by a stream `Sound` will cause an error.' 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/setPitch.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Set the pitch of the Source.', 4 | description = 'Sets the pitch of the Source.', 5 | arguments = { 6 | pitch = { 7 | type = 'number', 8 | description = 'The new pitch.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'pitch' }, 15 | returns = {} 16 | } 17 | }, 18 | notes = [[ 19 | The default pitch is 1. Every doubling/halving of the pitch will raise/lower the pitch by one 20 | octave. Changing the pitch also changes the playback speed. 21 | ]] 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/setVolume.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Set the volume of the Source.', 4 | description = 'Sets the current volume factor for the Source.', 5 | arguments = { 6 | volume = { 7 | type = 'number', 8 | description = 'The new volume.' 9 | }, 10 | units = { 11 | type = 'VolumeUnit', 12 | default = [['linear']], 13 | description = 'The units of the value.' 14 | } 15 | }, 16 | returns = {}, 17 | variants = { 18 | { 19 | arguments = { 'volume', 'units' }, 20 | returns = {} 21 | } 22 | }, 23 | notes = 'The volume will be clamped to a 0-1 range (0 dB).' 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/audio/Source/stop.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'sourcePlayback', 3 | summary = 'Stop the Source.', 4 | description = 'Stops the source, also rewinding it to the beginning.', 5 | arguments = {}, 6 | returns = {}, 7 | variants = { 8 | { 9 | arguments = {}, 10 | returns = {} 11 | } 12 | }, 13 | related = { 14 | 'Source:play', 15 | 'Source:pause', 16 | 'Source:isPlaying' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/audio/TimeUnit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Time units for sound samples.', 3 | description = [[ 4 | When figuring out how long a Source is or seeking to a specific position in the sound file, 5 | units can be expressed in terms of seconds or in terms of frames. A frame is one set of samples 6 | for each channel (one sample for mono, two samples for stereo). 7 | ]], 8 | values = { 9 | { 10 | name = 'seconds', 11 | description = 'Seconds.' 12 | }, 13 | { 14 | name = 'frames', 15 | description = 'Frames.' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/audio/VolumeUnit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different units of volume.', 3 | description = [[ 4 | When accessing the volume of Sources or the audio listener, this can be done in linear units 5 | with a 0 to 1 range, or in decibels with a range of -∞ to 0. 6 | ]], 7 | values = { 8 | { 9 | name = 'linear', 10 | description = 'Linear volume range.' 11 | }, 12 | { 13 | name = 'db', 14 | description = 'Decibels.' 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/audio/getPosition.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'listener', 3 | summary = 'Get the position of the listener.', 4 | description = 'Returns the position of the virtual audio listener, in meters.', 5 | arguments = {}, 6 | returns = { 7 | x = { 8 | type = 'number', 9 | description = 'The x position of the listener.' 10 | }, 11 | y = { 12 | type = 'number', 13 | description = 'The y position of the listener.' 14 | }, 15 | z = { 16 | type = 'number', 17 | description = 'The z position of the listener.' 18 | } 19 | }, 20 | variants = { 21 | { 22 | arguments = {}, 23 | returns = { 'x', 'y', 'z' } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/audio/getSampleRate.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'devices', 3 | summary = 'Get the playback device sample rate.', 4 | description = [[ 5 | Returns the sample rate used by the playback device. This can be changed using `lovr.conf`. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | rate = { 10 | type = 'number', 11 | description = 'The sample rate of the playback device, in Hz.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'rate' } 18 | } 19 | }, 20 | related = { 21 | 'lovr.conf' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/audio/isStarted.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'devices', 3 | summary = 'Check if an audio device is started.', 4 | description = 'Returns whether an audio device is started.', 5 | arguments = { 6 | type = { 7 | type = 'AudioType', 8 | default = [['playback']], 9 | description = 'The type of device to check.' 10 | } 11 | }, 12 | returns = { 13 | started = { 14 | type = 'boolean', 15 | description = 'Whether the device is active.' 16 | } 17 | }, 18 | variants = { 19 | { 20 | arguments = { 'type' }, 21 | returns = { 'started' } 22 | } 23 | }, 24 | related = { 25 | 'lovr.audio.start', 26 | 'lovr.audio.stop' 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/lovr/callbacks/mount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'callbacks', 3 | summary = 'Called when the headset is put on or taken off.', 4 | description = 'The `lovr.mount` callback is called when the headset is put on or taken off.', 5 | arguments = { 6 | mounted = { 7 | type = 'boolean', 8 | description = 'Whether the headset is mounted.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'mounted' }, 15 | returns = {} 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.isMounted' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/AnimationProperty.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different animated properties.', 3 | description = 'This indicates the different node properties that can be animated.', 4 | values = { 5 | { 6 | name = 'translation', 7 | description = 'Node translation.' 8 | }, 9 | { 10 | name = 'rotation', 11 | description = 'Node rotation.' 12 | }, 13 | { 14 | name = 'scale', 15 | description = 'Node scale.' 16 | }, 17 | { 18 | name = 'weights', 19 | description = 'Node blend shape weights.' 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/Blob/getName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the label of the Blob.', 3 | description = [[ 4 | Returns the filename the Blob was loaded from, or the custom name given to it when it was 5 | created. This label is also used in error messages. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | name = { 10 | type = 'string', 11 | description = 'The name of the Blob.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'name' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/Blob/getPointer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a raw pointer to the Blob\'s data.', 3 | description = [[ 4 | Returns a raw pointer to the Blob's data. This can be used to interface with other C libraries 5 | using the LuaJIT FFI. Use this only if you know what you're doing! 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | pointer = { 10 | type = 'userdata', 11 | description = 'A pointer to the data.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'pointer' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/Blob/getSize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the size of the Blob, in bytes.', 3 | description = [[ 4 | Returns the size of the Blob's contents, in bytes. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | bytes = { 9 | type = 'number', 10 | description = 'The size of the Blob, in bytes.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'bytes' } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/data/Image/encode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Encode the Image as png.', 3 | description = 'Encodes the Image to an uncompressed png. This intended mainly for debugging.', 4 | arguments = {}, 5 | returns = { 6 | blob = { 7 | type = 'Blob', 8 | description = 'A new Blob containing the PNG image data.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'blob' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.filesystem.write' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/Image/getBlob.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the bytes backing this Image as a `Blob`.', 3 | description = 'Returns a Blob containing the raw bytes of the Image.', 4 | arguments = {}, 5 | returns = { 6 | blob = { 7 | type = 'Blob', 8 | description = 'The Blob instance containing the bytes for the `Image`.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'blob' } 15 | } 16 | }, 17 | related = { 18 | 'Blob:getPointer', 19 | 'Sound:getBlob' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/Image/getDimensions.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the dimensions of the Image.', 3 | description = 'Returns the dimensions of the Image, in pixels.', 4 | arguments = {}, 5 | returns = { 6 | width = { 7 | type = 'number', 8 | description = 'The width of the Image, in pixels.' 9 | }, 10 | height = { 11 | type = 'number', 12 | description = 'The height of the Image, in pixels.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'width', 'height' } 19 | } 20 | }, 21 | related = { 22 | 'Image:getWidth', 23 | 'Image:getHeight', 24 | 'Texture:getDimensions' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/data/Image/getFormat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the pixel format of the Image.', 3 | description = 'Returns the format of the Image.', 4 | arguments = {}, 5 | returns = { 6 | format = { 7 | type = 'TextureFormat', 8 | description = 'The format of the pixels in the Image.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'format' } 15 | } 16 | }, 17 | related = { 18 | 'TextureFormat', 19 | 'Texture:getFormat' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/Image/getHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the height of the Image.', 3 | description = 'Returns the height of the Image, in pixels.', 4 | arguments = {}, 5 | returns = { 6 | height = { 7 | type = 'number', 8 | description = 'The height of the Image, in pixels.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'height' } 15 | } 16 | }, 17 | related = { 18 | 'Image:getWidth', 19 | 'Image:getDimensions', 20 | 'Texture:getHeight' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/Image/getWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the width of the Image.', 3 | description = 'Returns the width of the Image, in pixels.', 4 | arguments = {}, 5 | returns = { 6 | width = { 7 | type = 'number', 8 | description = 'The width of the Image, in pixels.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'width' } 15 | } 16 | }, 17 | related = { 18 | 'Image:getHeight', 19 | 'Image:getDimensions', 20 | 'Texture:getWidth' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getAnimationCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of animations in the model.', 3 | description = 'Returns the number of animations in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of animations in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getAnimationCount' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getAnimationName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the name of an animation.', 3 | description = 'Returns the name of an animation.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the animation.' 8 | } 9 | }, 10 | returns = { 11 | name = { 12 | type = 'string', 13 | description = 'The name of the animation.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'name' } 20 | } 21 | }, 22 | notes = 'If the animation does not have a name, this function returns `nil`.', 23 | related = { 24 | 'Model:getAnimationName' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getBlendShapeCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of blend shapes in the model.', 3 | description = 'Returns the number of blend shapes in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of blend shapes in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getBlendShapeName', 19 | 'Model:getBlendShapeCount' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getBlob.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a Blob in the model.', 3 | description = 'Returns one of the Blobs in the model, by index.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the Blob to get.' 8 | } 9 | }, 10 | returns = { 11 | blob = { 12 | type = 'Blob', 13 | description = 'The Blob object.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'blob' } 20 | } 21 | }, 22 | related = { 23 | 'ModelData:getBlobCount', 24 | 'ModelData:getImage' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getBlobCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of Blobs stored in the model.', 3 | description = 'Returns the number of Blobs in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of Blobs in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getBlob', 19 | 'ModelData:getImageCount' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getDepth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the depth of the model.', 3 | description = 'Returns the depth of the model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | depth = { 7 | type = 'number', 8 | description = 'The depth of the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'depth' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getWidth', 19 | 'ModelData:getHeight', 20 | 'ModelData:getDimensions', 21 | 'ModelData:getCenter', 22 | 'ModelData:getBoundingBox', 23 | 'Model:getDepth' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the height of the model.', 3 | description = 'Returns the height of the model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | height = { 7 | type = 'number', 8 | description = 'The height of the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'height' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getWidth', 19 | 'ModelData:getDepth', 20 | 'ModelData:getDimensions', 21 | 'ModelData:getCenter', 22 | 'ModelData:getBoundingBox', 23 | 'Model:getHeight' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getImage.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get an Image in the model.', 3 | description = 'Returns one of the Images in the model, by index.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the Image to get.' 8 | } 9 | }, 10 | returns = { 11 | image = { 12 | type = 'Image', 13 | description = 'The Image object.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'image' } 20 | } 21 | }, 22 | related = { 23 | 'ModelData:getImageCount', 24 | 'ModelData:getBlob' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getImageCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of Images stored in the model.', 3 | description = 'Returns the number of Images in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of Images in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getImage', 19 | 'ModelData:getBlobCount' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getMaterialCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of materials in the model.', 3 | description = 'Returns the number of materials in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of materials in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getMaterialName', 19 | 'ModelData:getMeshMaterial', 20 | 'ModelData:getMaterial', 21 | 'Model:getMaterialCount' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getMeshCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of meshes in the model.', 3 | description = 'Returns the number of meshes in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of meshes in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getNodeMeshes' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getMeshDrawMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the draw mode of a mesh.', 3 | description = [[ 4 | Returns the draw mode of a mesh. This controls how its vertices are connected together (points, 5 | lines, or triangles). 6 | ]], 7 | arguments = { 8 | mesh = { 9 | type = 'number', 10 | description = 'The index of a mesh.' 11 | } 12 | }, 13 | returns = { 14 | mode = { 15 | type = 'ModelDrawMode', 16 | description = 'The draw mode of the mesh.' 17 | } 18 | }, 19 | variants = { 20 | { 21 | arguments = { 'mesh' }, 22 | returns = { 'mode' } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getMeshMaterial.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the index of the material applied to a mesh.', 3 | description = 'Returns the index of the material applied to a mesh.', 4 | arguments = { 5 | mesh = { 6 | type = 'number', 7 | description = 'The index of a mesh.' 8 | } 9 | }, 10 | returns = { 11 | material = { 12 | type = 'number', 13 | description = [[ 14 | The index of the material applied to the mesh, or nil if the mesh does not have a material. 15 | ]] 16 | } 17 | }, 18 | variants = { 19 | { 20 | arguments = { 'mesh' }, 21 | returns = { 'material' } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getMeshVertexCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of vertices in a mesh.', 3 | description = 'Returns the number of vertices in a mesh.', 4 | arguments = { 5 | mesh = { 6 | type = 'number', 7 | description = 'The index of a mesh.' 8 | } 9 | }, 10 | returns = { 11 | count = { 12 | type = 'number', 13 | description = 'The number of vertices in the mesh.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'mesh' }, 19 | returns = { 'count' } 20 | } 21 | }, 22 | related = { 23 | 'ModelData:getMeshIndexCount' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getNodeCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of nodes in the model.', 3 | description = 'Returns the number of nodes in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of nodes in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getNodeCount' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getNodeName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the name of a node.', 3 | description = 'Returns the name of a node.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the node.' 8 | } 9 | }, 10 | returns = { 11 | name = { 12 | type = 'string', 13 | description = 'The name of the node.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'name' } 20 | } 21 | }, 22 | notes = 'If the node does not have a name, this function returns `nil`.', 23 | related = { 24 | 'Model:getNodeName' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getRootNode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the index of the root node.', 3 | description = 'Returns the index of the model\'s root node.', 4 | arguments = {}, 5 | returns = { 6 | root = { 7 | type = 'number', 8 | description = 'The index of the root node.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'root' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getNodeCount', 19 | 'ModelData:getNodeParent', 20 | 'Model:getRootNode' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getSkinCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of skins in the model.', 3 | description = [[ 4 | Returns the number of skins in the model. A skin is a collection of joints targeted by an 5 | animation. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | count = { 10 | type = 'number', 11 | description = 'The number of skins in the model.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'count' } 18 | } 19 | }, 20 | notes = 'There is currently a maximum of 256 skins.', 21 | related = { 22 | 'Model:hasJoints' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getSkinJoints.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the joints in a skin.', 3 | description = 'Returns a table with the node indices of the joints in a skin.', 4 | arguments = { 5 | skin = { 6 | type = 'number', 7 | description = 'The index of a skin.' 8 | } 9 | }, 10 | returns = { 11 | joints = { 12 | type = 'table', 13 | description = 'The joints in the skin.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'skin' }, 19 | returns = { 'joints' } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/ModelData/getWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the width of the model.', 3 | description = 'Returns the width of the model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | width = { 7 | type = 'number', 8 | description = 'The width of the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'width' } 15 | } 16 | }, 17 | related = { 18 | 'ModelData:getHeight', 19 | 'ModelData:getDepth', 20 | 'ModelData:getDimensions', 21 | 'ModelData:getCenter', 22 | 'ModelData:getBoundingBox', 23 | 'Model:getWidth' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/getAscent.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the ascent of the font.', 3 | description = [[ 4 | Returns the ascent metric of the font, in pixels. The ascent represents how far any glyph of 5 | the font ascends above the baseline. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | ascent = { 10 | type = 'number', 11 | description = 'The ascent of the font, in pixels.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'ascent' } 18 | } 19 | }, 20 | related = { 21 | 'Rasterizer:getDescent', 22 | 'Font:getAscent' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/getDescent.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the descent of the font.', 3 | description = [[ 4 | Returns the descent metric of the font, in pixels. The descent represents how far any glyph of 5 | the font descends below the baseline. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | descent = { 10 | type = 'number', 11 | description = 'The descent of the font, in pixels.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'descent' } 18 | } 19 | }, 20 | related = { 21 | 'Rasterizer:getAscent', 22 | 'Font:getDescent' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/getFontSize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the size of the font.', 3 | description = [[ 4 | Returns the size of the font, in pixels. This is the size the rasterizer was created with, and 5 | defines the size of images it rasterizes. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | size = { 10 | type = 'number', 11 | description = 'The font size, in pixels.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'size' } 18 | } 19 | }, 20 | related = { 21 | 'Rasterizer:getHeight' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/getGlyphCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of glyphs stored in the font file.', 3 | description = 'Returns the number of glyphs stored in the font file.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of glyphs stored in the font file.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Rasterizer:hasGlyphs' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/getLeading.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the leading of the font.', 3 | description = [[ 4 | Returns the leading metric of the font, in pixels. This is the full amount of space between 5 | lines. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | leading = { 10 | type = 'number', 11 | description = 'The font leading, in pixels.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'leading' } 18 | } 19 | }, 20 | related = { 21 | 'Rasterizer:getAscent', 22 | 'Rasterizer:getDescent' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/Rasterizer/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'An object that rasterizes glyphs from font files.', 3 | description = [[ 4 | A Rasterizer is an object that parses a TTF file, decoding and rendering glyphs from it. 5 | 6 | Usually you can just use `Font` objects. 7 | ]], 8 | constructor = 'lovr.data.newRasterizer' 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/data/SampleFormat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different data types for samples in a Sound.', 3 | description = 'Sounds can store audio samples as 16 bit integers or 32 bit floats.', 4 | values = { 5 | { 6 | name = 'f32', 7 | description = '32 bit floating point samples (between -1.0 and 1.0).' 8 | }, 9 | { 10 | name = 'i16', 11 | description = '16 bit integer samples (between -32768 and 32767).' 12 | } 13 | }, 14 | related = { 15 | 'lovr.data.newSound', 16 | 'Sound:getFormat' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/data/SmoothMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different ways to interpolate between animation keyframes.', 3 | description = 'Different ways to interpolate between animation keyframes.', 4 | values = { 5 | { 6 | name = 'step', 7 | description = 'The animated property will snap to the nearest keyframe.' 8 | }, 9 | { 10 | name = 'linear', 11 | description = 'The animated property will linearly interpolate between keyframes.' 12 | }, 13 | { 14 | name = 'cubic', 15 | description = 'The animated property will follow a smooth curve between nearby keyframes.' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getBlob.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the bytes backing this Sound as a Blob.', 3 | description = 'Returns a Blob containing the raw bytes of the Sound.', 4 | arguments = {}, 5 | returns = { 6 | blob = { 7 | type = 'Blob', 8 | description = 'The Blob instance containing the bytes for the `Sound`.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'blob' } 15 | } 16 | }, 17 | notes = [[ 18 | Samples for each channel are stored interleaved. The data type of each sample is given by 19 | `Sound:getFormat`. 20 | ]], 21 | related = { 22 | 'Blob:getPointer', 23 | 'Image:getBlob' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getChannelCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of channels in the Sound.', 3 | description = [[ 4 | Returns the number of channels in the Sound. Mono sounds have 1 channel, stereo sounds have 2 5 | channels, and ambisonic sounds have 4 channels. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | channels = { 10 | type = 'number', 11 | description = 'The number of channels in the sound.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'channels' } 18 | } 19 | }, 20 | related = { 21 | 'Sound:getChannelLayout', 22 | 'Sound:getByteStride' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getChannelLayout.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the channel layout of the Sound.', 3 | description = 'Returns the channel layout of the Sound.', 4 | arguments = {}, 5 | returns = { 6 | channels = { 7 | type = 'ChannelLayout', 8 | description = 'The channel layout.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'channels' } 15 | } 16 | }, 17 | related = { 18 | 'Sound:getChannelCount', 19 | 'Sound:getByteStride' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getDuration.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the duration of the Sound.', 3 | description = 'Returns the duration of the Sound, in seconds.', 4 | arguments = {}, 5 | returns = { 6 | duration = { 7 | type = 'number', 8 | description = 'The duration of the Sound, in seconds.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'duration' } 15 | } 16 | }, 17 | notes = 'This can be computed as `(frameCount / sampleRate)`.', 18 | related = { 19 | 'Sound:getFrameCount', 20 | 'Sound:getSampleCount', 21 | 'Sound:getSampleRate', 22 | 'Source:getDuration' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getFormat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the sample format of the Sound.', 3 | description = 'Returns the sample format of the Sound.', 4 | arguments = {}, 5 | returns = { 6 | format = { 7 | type = 'SampleFormat', 8 | description = 'The data type of each sample.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'format' } 15 | } 16 | }, 17 | related = { 18 | 'Sound:getChannelLayout', 19 | 'Sound:getByteStride', 20 | 'Sound:getSampleRate' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getSampleCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of samples in the Sound.', 3 | description = 'Returns the total number of samples in the Sound.', 4 | arguments = {}, 5 | returns = { 6 | samples = { 7 | type = 'number', 8 | description = 'The total number of samples in the Sound.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'samples' } 15 | } 16 | }, 17 | notes = 'For streams, this returns the number of samples in the stream\'s buffer.', 18 | related = { 19 | 'Sound:getDuration', 20 | 'Sound:getFrameCount', 21 | 'Sound:getChannelCount' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/getSampleRate.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the sample rate of the Sound.', 3 | description = [[ 4 | Returns the sample rate of the Sound, in Hz. This is the number of frames that are played every 5 | second. It's usually a high number like 48000. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | frequency = { 10 | type = 'number', 11 | description = 'The number of frames per second in the Sound.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'frequency' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/data/Sound/isStream.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the Sound is a stream.', 3 | description = 'Returns whether the Sound is a stream.', 4 | arguments = {}, 5 | returns = { 6 | stream = { 7 | type = 'boolean', 8 | description = 'Whether the Sound is a stream.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'stream' } 15 | } 16 | }, 17 | related = { 18 | 'Sound:isCompressed', 19 | 'lovr.data.newSound' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/data/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'modules', 3 | summary = 'Exposes low level functions for working with data.', 4 | description = [[ 5 | The `lovr.data` module provides functions for accessing underlying data representations for 6 | several LÖVR objects. 7 | ]] 8 | } 9 | -------------------------------------------------------------------------------- /api/lovr/event/DisplayType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Distinguishes between the headset and window displays.', 3 | description = [[ 4 | This enum is used to distinguish whether a display is the headset display or the desktop window. 5 | ]], 6 | values = { 7 | { 8 | name = 'headset', 9 | description = 'The headset.' 10 | }, 11 | { 12 | name = 'window', 13 | description = 'The desktop window.' 14 | } 15 | }, 16 | related = { 17 | 'lovr.focus', 18 | 'lovr.visible' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/event/clear.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Clear the event queue.', 3 | description = 'Clears the event queue, removing any unprocessed events.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /api/lovr/event/restart.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Restart the application.', 3 | description = 'Pushes an event to restart the framework.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | }, 12 | notes = [[ 13 | The event won't be processed until the next time `lovr.event.poll` is called. 14 | 15 | The `lovr.restart` callback can be used to persist a value between restarts. 16 | ]], 17 | related = { 18 | 'lovr.restart', 19 | 'lovr.event.poll', 20 | 'lovr.event.quit' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/getMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the mode the file was opened in.', 3 | description = 'Returns the mode the file was opened in.', 4 | arguments = {}, 5 | returns = { 6 | mode = { 7 | type = 'OpenMode', 8 | description = 'The mode the file was opened in (`r`, `w`, or `a`).' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'mode' } 15 | } 16 | }, 17 | related = { 18 | 'File:getPath' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/getPath.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the file\'s path.', 3 | description = 'Returns the file\'s path.', 4 | arguments = {}, 5 | returns = { 6 | path = { 7 | type = 'string', 8 | description = 'The file path.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'path' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/getSize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the size of the File.', 3 | description = 'Returns the size of the file, in bytes.', 4 | arguments = {}, 5 | returns = { 6 | size = { 7 | type = 'number', 8 | description = 'The size of the file, in bytes, or nil if an error occurred.' 9 | }, 10 | error = { 11 | type = 'string', 12 | description = 'The error message, if an error occurred.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'size', 'error' } 19 | } 20 | }, 21 | related = { 22 | 'lovr.filesystem.getSize' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Represents an open file handle.', 3 | description = [[ 4 | A File is an object that provides read or write access to a file on the filesystem. 5 | ]], 6 | constructors = { 7 | 'lovr.filesystem.newFile' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/isEOF.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the end of the file has been reached.', 3 | description = [[ 4 | Returns whether the end of file has been reached. When true, `File:read` will no longer return 5 | data. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | eof = { 10 | type = 'boolean', 11 | description = 'Whether the end of the file has been reached.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'eof' } 18 | } 19 | }, 20 | related = { 21 | 'File:seek', 22 | 'File:tell', 23 | 'File:getSize' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/seek.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Seek to a position in the file.', 3 | description = [[ 4 | Seeks to a new position in the file. `File:read` and `File:write` will read/write relative to 5 | this position. 6 | ]], 7 | arguments = { 8 | offset = { 9 | type = 'number', 10 | description = 'The new file offset, in bytes.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'offset' }, 17 | returns = {} 18 | } 19 | }, 20 | related = { 21 | 'File:tell', 22 | 'File:getSize' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/filesystem/File/tell.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the seek position of the file.', 3 | description = [[ 4 | Returns the seek position of the file, which is where `File:read` and `File:write will 5 | read/write from. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | offset = { 10 | type = 'number', 11 | description = 'The file offset, in bytes.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'offset' } 18 | } 19 | }, 20 | related = { 21 | 'File:seek' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/filesystem/FileAction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different actions that can be taken on files.', 3 | description = [[ 4 | The different actions that can be taken on files, reported by `lovr.filechanged` when filesystem 5 | watching is active. 6 | ]], 7 | values = { 8 | { 9 | name = 'create', 10 | description = 'The file was created.' 11 | }, 12 | { 13 | name = 'delete', 14 | description = 'The file was deleted.' 15 | }, 16 | { 17 | name = 'modify', 18 | description = 'The file\'s contents were modified.' 19 | }, 20 | { 21 | name = 'rename', 22 | description = 'The file was renamed.' 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/filesystem/OpenMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different ways to open a file.', 3 | description = 'Different ways to open a `File` with `lovr.filesystem.newFile`.', 4 | values = { 5 | { 6 | name = 'r', 7 | description = 'Open the file for reading.' 8 | }, 9 | { 10 | name = 'w', 11 | description = 'Open the file for writing (overwrites existing data).' 12 | }, 13 | { 14 | name = 'a', 15 | description = 'Open the file for appending.' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getAppdataDirectory.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-paths', 3 | summary = 'Get the application data directory.', 4 | description = [[ 5 | Returns the application data directory. This will be something like: 6 | 7 | - `C:\Users\user\AppData\Roaming` on Windows. 8 | - `/home/user/.config` on Linux. 9 | - `/Users/user/Library/Application Support` on macOS. 10 | ]], 11 | arguments = {}, 12 | returns = { 13 | path = { 14 | type = 'string', 15 | description = 'The absolute path to the appdata directory.' 16 | } 17 | }, 18 | variants = { 19 | { 20 | arguments = {}, 21 | returns = { 'path' } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getExecutablePath.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-paths', 3 | summary = 'Get the path of the LÖVR executable.', 4 | description = 'Returns the absolute path of the LÖVR executable.', 5 | arguments = {}, 6 | returns = { 7 | path = { 8 | type = 'string', 9 | description = 'The absolute path of the LÖVR executable, or `nil` if it is unknown.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'path' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getSize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-files', 3 | summary = 'Get the size of a file.', 4 | description = 'Returns the size of a file, in bytes.', 5 | arguments = { 6 | file = { 7 | type = 'string', 8 | description = 'The file.' 9 | } 10 | }, 11 | returns = { 12 | size = { 13 | type = 'number', 14 | description = 'The size of the file, in bytes.' 15 | } 16 | }, 17 | variants = { 18 | { 19 | arguments = { 'file' }, 20 | returns = { 'size' } 21 | } 22 | }, 23 | notes = 'If the file does not exist, an error is thrown.', 24 | related = { 25 | 'File:getSize' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getSource.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-paths', 3 | summary = 'Get the location of the project source.', 4 | description = 'Get the absolute path of the project\'s source directory or archive.', 5 | arguments = {}, 6 | returns = { 7 | path = { 8 | type = 'string', 9 | description = 'The absolute path of the project\'s source, or `nil` if it\'s unknown.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'path' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getUserDirectory.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-paths', 3 | summary = 'Get the location of the user\'s home directory.', 4 | description = 'Returns the absolute path of the user\'s home directory.', 5 | arguments = {}, 6 | returns = { 7 | path = { 8 | type = 'string', 9 | description = 'The absolute path of the user\'s home directory.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'path' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/filesystem/getWorkingDirectory.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-paths', 3 | summary = 'Get the current working directory.', 4 | description = [[ 5 | Returns the absolute path of the working directory. Usually this is where the executable was 6 | started from. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | path = { 11 | type = 'string', 12 | description = 'The current working directory, or `nil` if it\'s unknown.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'path' } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/filesystem/isDirectory.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-files', 3 | summary = 'Check whether a path is a directory.', 4 | description = 'Check if a path exists and is a directory.', 5 | arguments = { 6 | path = { 7 | type = 'string', 8 | description = 'The path to check.' 9 | } 10 | }, 11 | returns = { 12 | isDirectory = { 13 | type = 'boolean', 14 | description = 'Whether or not the path is a directory.' 15 | } 16 | }, 17 | variants = { 18 | { 19 | arguments = { 'path' }, 20 | returns = { 'isDirectory' } 21 | } 22 | }, 23 | related = { 24 | 'lovr.filesystem.isFile' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/filesystem/isFile.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-files', 3 | summary = 'Check whether a path is a file.', 4 | description = 'Check if a path exists and is a file.', 5 | arguments = { 6 | path = { 7 | type = 'string', 8 | description = 'The path to check.' 9 | } 10 | }, 11 | returns = { 12 | isFile = { 13 | type = 'boolean', 14 | description = 'Whether or not the path is a file.' 15 | } 16 | }, 17 | variants = { 18 | { 19 | arguments = { 'path' }, 20 | returns = { 'isFile' } 21 | } 22 | }, 23 | related = { 24 | 'lovr.filesystem.isDirectory' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/filesystem/isFused.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-virtual', 3 | summary = 'Check if the project is fused.', 4 | description = 'Returns whether the current project source is fused to the executable.', 5 | arguments = {}, 6 | returns = { 7 | fused = { 8 | type = 'boolean', 9 | description = 'Whether or not the project is fused.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'fused' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/filesystem/newBlob.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-files', 3 | summary = 'Create a new Blob from a file.', 4 | description = 'Creates a new Blob that contains the contents of a file.', 5 | arguments = { 6 | filename = { 7 | type = 'string', 8 | description = 'The file to load.' 9 | } 10 | }, 11 | returns = { 12 | blob = { 13 | type = 'Blob', 14 | description = 'The new Blob.' 15 | } 16 | }, 17 | variants = { 18 | { 19 | arguments = { 'filename' }, 20 | returns = { 'blob' } 21 | } 22 | }, 23 | related = { 24 | 'lovr.data.newBlob', 25 | 'Blob' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/lovr/filesystem/unwatch.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'filesystem-files', 3 | summary = 'Stop watching files.', 4 | description = 'Stops watching files.', 5 | arguments = {}, 6 | returns = {}, 7 | variants = { 8 | { 9 | arguments = {}, 10 | returns = {} 11 | } 12 | }, 13 | related = { 14 | 'lovr.filesystem.watch', 15 | 'lovr.filechanged' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/graphics/Buffer/getLength.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'buffer-metadata', 3 | summary = 'Get the length of the Buffer.', 4 | description = [[ 5 | Returns the length of the Buffer, or `nil` if the Buffer was not created with a format. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | length = { 10 | type = 'number', 11 | description = 'The length of the Buffer.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'length' } 18 | } 19 | }, 20 | related = { 21 | 'Buffer:getSize', 22 | 'Buffer:getStride' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/graphics/Buffer/getSize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'buffer-metadata', 3 | summary = 'Get the size of the Buffer, in bytes.', 4 | description = [[ 5 | Returns the size of the Buffer in VRAM, in bytes. This is the same as `length * stride`. 6 | 7 | The size of the Buffer can't change after it's created. 8 | ]], 9 | arguments = {}, 10 | returns = { 11 | size = { 12 | type = 'number', 13 | description = 'The size of the Buffer, in bytes.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'size' } 20 | } 21 | }, 22 | related = { 23 | 'Buffer:getLength', 24 | 'Buffer:getStride' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Buffer/isTemporary.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'buffer-metadata', 4 | summary = 'Check if the Buffer is temporary.', 5 | description = 'Returns whether the Buffer is temporary.', 6 | arguments = {}, 7 | returns = { 8 | temporary = { 9 | type = 'boolean', 10 | description = 'Whether the Buffer is temporary.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'temporary' } 17 | } 18 | }, 19 | related = { 20 | 'lovr.graphics.getBuffer' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/CullMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different ways of doing face culling.', 3 | description = 'The different ways of doing triangle backface culling.', 4 | values = { 5 | { 6 | name = 'none', 7 | description = 'Both sides of triangles will be drawn.' 8 | }, 9 | { 10 | name = 'back', 11 | description = 'Skips rendering the back side of triangles.' 12 | }, 13 | { 14 | name = 'front', 15 | description = 'Skips rendering the front side of triangles.' 16 | } 17 | }, 18 | related = { 19 | 'Winding', 20 | 'Pass:setCullMode', 21 | 'Pass:setWinding' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/DrawStyle.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different styles to draw shapes.', 3 | description = 'Whether a shape should be drawn filled or outlined.', 4 | values = { 5 | { 6 | name = 'fill', 7 | description = 'The shape will be filled in (the default).' 8 | }, 9 | { 10 | name = 'line', 11 | description = 'The shape will be outlined.' 12 | } 13 | }, 14 | related = { 15 | 'Pass:plane', 16 | 'Pass:cube', 17 | 'Pass:box', 18 | 'Pass:circle' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/graphics/Font/getLineSpacing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the line spacing of the Font.', 3 | description = [[ 4 | Returns the line spacing of the Font. When spacing out lines, the height of the font is 5 | multiplied the line spacing to get the final spacing value. The default is 1.0. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | spacing = { 10 | type = 'number', 11 | description = 'The line spacing of the font.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'spacing' } 18 | } 19 | }, 20 | related = { 21 | 'Font:getHeight' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Font/getRasterizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the Font\'s Rasterizer.', 3 | description = 'Returns the Rasterizer object backing the Font.', 4 | arguments = {}, 5 | returns = { 6 | rasterizer = { 7 | type = 'Rasterizer', 8 | description = 'The Rasterizer.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'rasterizer' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.graphics.newFont', 19 | 'lovr.data.newRasterizer' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Font/setLineSpacing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the line spacing of the Font.', 3 | description = [[ 4 | Sets the line spacing of the Font. When spacing out lines, the height of the font is multiplied 5 | by the line spacing to get the final spacing value. The default is 1.0. 6 | ]], 7 | arguments = { 8 | spacing = { 9 | type = 'number', 10 | description = 'The new line spacing.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'spacing' }, 17 | returns = {} 18 | } 19 | }, 20 | related = { 21 | 'Font:getHeight' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/HorizontalAlign.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different ways to horizontally align text.', 3 | description = 'Different ways to horizontally align text with `Pass:text`.', 4 | values = { 5 | { 6 | name = 'left', 7 | description = 'Left-aligned text.' 8 | }, 9 | { 10 | name = 'center', 11 | description = 'Centered text.' 12 | }, 13 | { 14 | name = 'right', 15 | description = 'Right-aligned text.' 16 | } 17 | }, 18 | related = { 19 | 'VerticalAlign', 20 | 'Pass:text', 21 | 'Font:getVertices' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Material/getProperties.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the properties of the Material.', 3 | description = 'Returns the properties of the Material in a table.', 4 | arguments = {}, 5 | returns = { 6 | properties = { 7 | type = 'table', 8 | description = 'The Material properties.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'properties' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/getDrawMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the draw mode of the Mesh.', 3 | description = [[ 4 | Returns the `DrawMode` of the mesh, which controls how the vertices in the Mesh are connected 5 | together to create pixels. The default is `triangles`. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | mode = { 10 | type = 'DrawMode', 11 | description = 'The current draw mode.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'mode' } 18 | } 19 | }, 20 | related = { 21 | 'Pass:setMeshMode' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/getIndices.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the vertex indices in the Mesh.', 3 | description = 'Returns a table with the Mesh\'s vertex indices.', 4 | arguments = {}, 5 | returns = { 6 | t = { 7 | type = 'table', 8 | description = 'A table of numbers with the 1-based vertex indices.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 't' } 15 | } 16 | }, 17 | notes = [[ 18 | This function will be very very slow if the Mesh's storage is `gpu`, because the data needs to 19 | be downloaded from the GPU. 20 | ]], 21 | related = { 22 | 'Mesh:getIndexBuffer', 23 | 'Mesh:setIndexBuffer' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/getMaterial.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the Material applied to the Mesh.', 3 | description = 'Returns the `Material` applied to the Mesh.', 4 | arguments = {}, 5 | returns = { 6 | material = { 7 | type = 'Material', 8 | description = 'The material.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'material' } 15 | } 16 | }, 17 | related = { 18 | 'Pass:setMaterial', 19 | 'Model:getMaterial', 20 | 'lovr.graphics.newMaterial' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/getVertexCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of vertices in the Mesh.', 3 | description = [[ 4 | Returns the number of vertices in the Mesh. The vertex count is set when the Mesh is created 5 | and can't change afterwards. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | count = { 10 | type = 'number', 11 | description = 'The number of vertices in the Mesh.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'count' } 18 | } 19 | }, 20 | related = { 21 | 'Mesh:getVertexStride', 22 | 'Mesh:getVertexFormat', 23 | 'lovr.graphics.newMesh', 24 | 'Model:getMesh' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/getVertexStride.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the size of each vertex in the Mesh.', 3 | description = 'Returns the stride of the Mesh, which is the number of bytes used by each vertex.', 4 | arguments = {}, 5 | returns = { 6 | stride = { 7 | type = 'number', 8 | description = 'The stride of the Mesh, in bytes.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'stride' } 15 | } 16 | }, 17 | related = { 18 | 'Mesh:getVertexCount', 19 | 'Mesh:getVertexFormat', 20 | 'lovr.graphics.newMesh' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Mesh/setDrawMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the draw mode of the Mesh.', 3 | description = [[ 4 | Changes the `DrawMode` of the mesh, which controls how the vertices in the Mesh are connected 5 | together to create pixels. The default is `triangles`. 6 | ]], 7 | arguments = { 8 | mode = { 9 | type = 'DrawMode', 10 | description = 'The current draw mode.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'mode' }, 17 | returns = {} 18 | } 19 | }, 20 | related = { 21 | 'Pass:setMeshMode' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getAnimationCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of animations in the Model.', 3 | description = 'Returns the number of animations in the Model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of animations in the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getAnimationName', 19 | 'Model:getAnimationDuration', 20 | 'Model:animate' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getAnimationName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the name of an animation in the Model.', 3 | description = 'Returns the name of an animation in the Model.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of an animation.' 8 | } 9 | }, 10 | returns = { 11 | name = { 12 | type = 'string', 13 | description = 'The name of the animation.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'name' } 20 | } 21 | }, 22 | related = { 23 | 'Model:getAnimationCount', 24 | 'Model:getAnimationDuration' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getBlendShapeCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of blend shapes in the model.', 3 | description = 'Returns the number of blend shapes in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of blend shapes in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getBlendShapeName', 19 | 'ModelData:getBlendShapeCount' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getData.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the ModelData backing the Model.', 3 | description = 'Returns the ModelData this Model was created from.', 4 | arguments = {}, 5 | returns = { 6 | data = { 7 | type = 'ModelData', 8 | description = 'The ModelData.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'data' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.data.newModelData' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getDepth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the depth of the Model.', 3 | description = 'Returns the depth of the Model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | depth = { 7 | type = 'number', 8 | description = 'The depth of the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'depth' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getWidth', 19 | 'Model:getHeight', 20 | 'Model:getDimensions', 21 | 'Model:getCenter', 22 | 'Model:getBoundingBox', 23 | 'ModelData:getDepth' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the height of the Model.', 3 | description = 'Returns the height of the Model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | height = { 7 | type = 'number', 8 | description = 'The height of the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'height' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getWidth', 19 | 'Model:getDepth', 20 | 'Model:getDimensions', 21 | 'Model:getCenter', 22 | 'Model:getBoundingBox', 23 | 'ModelData:getHeight' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getIndexBuffer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a Buffer containing the triangle indices in the Model.', 3 | description = [[ 4 | Returns the index buffer used by the Model. The index buffer describes the order used to draw 5 | the vertices in each mesh. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | buffer = { 10 | type = 'Buffer', 11 | description = 'The index buffer.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'buffer' } 18 | } 19 | }, 20 | related = { 21 | 'Model:getVertexBuffer', 22 | 'Model:getMesh' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getMaterialCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of materials in the Model.', 3 | description = 'Returns the number of materials in the Model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of materials in the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getMaterialName', 19 | 'Model:getMaterial' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getMaterialName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the name of a material in the Model.', 3 | description = 'Returns the name of a material in the Model.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of a material.' 8 | } 9 | }, 10 | returns = { 11 | name = { 12 | type = 'string', 13 | description = 'The name of the material.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'name' } 20 | } 21 | }, 22 | related = { 23 | 'Model:getMaterialCount', 24 | 'Model:getMaterial' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getMesh.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a Mesh from the Model.', 3 | description = 'Returns a `Mesh` from the Model.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the Mesh to return.' 8 | } 9 | }, 10 | returns = { 11 | mesh = { 12 | type = 'Mesh', 13 | description = 'The mesh object.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'mesh' } 20 | } 21 | }, 22 | related = { 23 | 'Model:getMeshCount', 24 | 'lovr.graphics.newMesh' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getMeshCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of meshes in the Model.', 3 | description = 'Returns the number of meshes in the Model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of meshes in the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getMesh' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getNodeCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of nodes in the model.', 3 | description = 'Returns the number of nodes in the model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of nodes in the model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getNodeName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the name of a node in the Model.', 3 | description = 'Returns the name of a node.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the node.' 8 | } 9 | }, 10 | returns = { 11 | name = { 12 | type = 'string', 13 | description = 'The name of the node.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'name' } 20 | } 21 | }, 22 | related = { 23 | 'Model:getNodeCount', 24 | 'Model:getAnimationName', 25 | 'Model:getMaterialName' 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getRootNode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the index of the root node.', 3 | description = 'Returns the index of the model\'s root node.', 4 | arguments = {}, 5 | returns = { 6 | root = { 7 | type = 'number', 8 | description = 'The index of the root node.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'root' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getNodeCount', 19 | 'Model:getNodeParent' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getTexture.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get one of the textures in the Model.', 3 | description = 'Returns one of the textures in the Model.', 4 | arguments = { 5 | index = { 6 | type = 'number', 7 | description = 'The index of the texture to get.' 8 | } 9 | }, 10 | returns = { 11 | texture = { 12 | type = 'Texture', 13 | description = 'The texture.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'index' }, 19 | returns = { 'texture' } 20 | } 21 | }, 22 | related = { 23 | 'Model:getTextureCount', 24 | 'Model:getMaterial' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getTextureCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of textures in the Model.', 3 | description = 'Returns the number of textures in the Model.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of textures in the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getTexture' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getVertexBuffer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a Buffer containing the vertices in the Model.', 3 | description = 'Returns a `Buffer` that holds the vertices of all of the meshes in the Model.', 4 | arguments = {}, 5 | returns = { 6 | buffer = { 7 | type = 'Buffer', 8 | description = 'The vertex buffer.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'buffer' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getIndexBuffer', 19 | 'Model:getMesh' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/getWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the width of the Model.', 3 | description = 'Returns the width of the Model, computed from its axis-aligned bounding box.', 4 | arguments = {}, 5 | returns = { 6 | width = { 7 | type = 'number', 8 | description = 'The width of the Model.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'width' } 15 | } 16 | }, 17 | related = { 18 | 'Model:getHeight', 19 | 'Model:getDepth', 20 | 'Model:getDimensions', 21 | 'Model:getCenter', 22 | 'Model:getBoundingBox', 23 | 'ModelData:getWidth' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/resetBlendShapes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Reset blend shape weights.', 3 | description = 'Resets blend shape weights to the original ones defined in the model file.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | }, 12 | related = { 13 | 'Model:resetNodeTransforms', 14 | 'Model:getBlendShapeWeight', 15 | 'Model:setBlendShapeWeight' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/graphics/Model/resetNodeTransforms.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Reset node transforms.', 3 | description = 'Resets node transforms to the original ones defined in the model file.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | }, 12 | related = { 13 | 'Model:resetBlendShapes' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/getSampleCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'canvas', 4 | summary = 'Get the antialiasing setting of a render pass.', 5 | description = 'Returns the antialiasing setting of a render pass.', 6 | arguments = {}, 7 | returns = { 8 | samples = { 9 | type = 'number', 10 | description = 'The number of samples used for rendering. Currently, will be 1 or 4.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'samples' } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/getTarget.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'canvas', 4 | summary = 'Get the textures a render pass is rendering to.', 5 | description = 'Returns the textures a render pass is rendering to.', 6 | arguments = {}, 7 | returns = { 8 | target = { 9 | type = 'table', 10 | description = [[ 11 | A table of the color textures targeted by the pass, with an additional `depth` key if the 12 | pass has a depth texture. 13 | ]] 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'target' } 20 | } 21 | }, 22 | related = { 23 | 'Pass:getClear' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/getType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'pass-misc', 4 | summary = 'Get the type of the Pass.', 5 | description = [[ 6 | Returns the type of the pass (render, compute, or transfer). The type restricts what kinds of 7 | functions can be called on the pass. 8 | ]], 9 | arguments = {}, 10 | returns = { 11 | type = { 12 | type = 'PassType', 13 | description = 'The type of the Pass.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'type' } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/origin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'transform', 3 | summary = 'Reset the transform to the origin.', 4 | description = 'Resets the transform back to the origin.', 5 | arguments = {}, 6 | returns = {}, 7 | variants = { 8 | { 9 | arguments = {}, 10 | returns = {} 11 | } 12 | }, 13 | related = { 14 | 'Pass:translate', 15 | 'Pass:rotate', 16 | 'Pass:scale', 17 | 'Pass:transform', 18 | 'Pass:push', 19 | 'Pass:pop' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/reset.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'pass-misc', 3 | summary = 'Reset the Pass.', 4 | description = [[ 5 | Resets the Pass, clearing all of its draws and computes and resetting all of its state to the 6 | default values. 7 | ]], 8 | arguments = {}, 9 | returns = {}, 10 | variants = { 11 | { 12 | arguments = {}, 13 | returns = {} 14 | } 15 | }, 16 | notes = [[ 17 | The following things won't be reset: 18 | 19 | - Pass canvas, set with `Pass:setCanvas`. 20 | - Pass clears, set with `Pass:setClear`. 21 | - The tally buffer, set with `Pass:setTallyBuffer`. 22 | ]] 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/setFont.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'pipeline', 3 | summary = 'Set the font.', 4 | description = 'Sets the font used for `Pass:text`.', 5 | arguments = { 6 | font = { 7 | type = 'Font', 8 | description = 'The Font to use when rendering text.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'font' }, 15 | returns = {} 16 | } 17 | }, 18 | related = { 19 | 'Pass:text', 20 | 'lovr.graphics.newFont', 21 | 'lovr.graphics.getDefaultFont' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Pass/setMeshMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'pipeline', 3 | summary = 'Change the way vertices are connected together.', 4 | description = 'Changes the way vertices are connected together when drawing using `Pass:mesh`.', 5 | arguments = { 6 | mode = { 7 | type = 'DrawMode', 8 | description = 'The mesh mode to use.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'mode' }, 15 | returns = {} 16 | } 17 | }, 18 | notes = 'The default mesh mode is `triangles`.' 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/graphics/Readback/getBlob.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get Readback\'s data as a Blob.', 3 | description = 'Returns the Readback\'s data as a Blob.', 4 | arguments = {}, 5 | returns = { 6 | blob = { 7 | type = 'Blob', 8 | description = 'The Blob.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'blob' } 15 | } 16 | }, 17 | notes = 'If the Readback is reading back a Texture, returns `nil`.', 18 | related = { 19 | 'Readback:getData', 20 | 'Readback:getImage' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Readback/getData.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get Readback\'s data as a table.', 3 | description = [[ 4 | Returns the data from the Readback, as a table. See `Buffer:getData` for the way the table is 5 | structured. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | data = { 10 | type = 'table', 11 | description = 'A table containing the data that was read back.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'data' } 18 | } 19 | }, 20 | notes = 'This returns `nil` for readbacks of `Texture` objects.', 21 | related = { 22 | 'Readback:getBlob', 23 | 'Readback:getImage' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Readback/getImage.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get Readback\'s data as an Image.', 3 | description = 'Returns the Readback\'s data as an Image.', 4 | arguments = {}, 5 | returns = { 6 | image = { 7 | type = 'Image', 8 | description = 'The Image.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'image' } 15 | } 16 | }, 17 | notes = 'If the Readback is not reading back a Texture, returns `nil`.', 18 | related = { 19 | 'Readback:getData', 20 | 'Readback:getBlob' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Readback/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'An asynchronous read of a GPU resource.', 3 | description = [[ 4 | Readbacks track the progress of an asynchronous read of a `Buffer` or `Texture`. The Readback 5 | can be polled for completion or the CPU with `Readback:isComplete`, or you can wait for it to 6 | finish using `Readback:wait`. 7 | ]], 8 | constructors = { 9 | 'Buffer:newReadback', 10 | 'Texture:newReadback' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /api/lovr/graphics/Readback/isComplete.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if a Readback is complete.', 3 | description = 'Returns whether the Readback has completed on the GPU and its data is available.', 4 | arguments = {}, 5 | returns = { 6 | complete = { 7 | type = 'boolean', 8 | description = 'Whether the readback is complete.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'complete' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/graphics/Shader/getType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the type of the Shader.', 3 | description = 'Returns whether the shader is a graphics or compute shader.', 4 | arguments = {}, 5 | returns = { 6 | type = { 7 | type = 'ShaderType', 8 | description = 'The type of the Shader.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'type' } 15 | } 16 | }, 17 | related = { 18 | 'Shader:hasStage', 19 | 'lovr.graphics.newShader' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/Shader/hasStage.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the Shader has a given stage.', 3 | description = 'Returns whether the Shader has a given stage.', 4 | arguments = { 5 | stage = { 6 | type = 'ShaderStage', 7 | description = 'The stage.' 8 | } 9 | }, 10 | returns = { 11 | exists = { 12 | type = 'boolean', 13 | description = 'Whether the Shader has the stage.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'stage' }, 19 | returns = { 'exists' } 20 | } 21 | }, 22 | related = { 23 | 'Shader:getType' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/graphics/Shader/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'GPU program.', 3 | description = [[ 4 | Shaders are small GPU programs. See the `Shaders` guide for a full introduction to Shaders. 5 | ]], 6 | constructors = { 7 | 'lovr.graphics.newShader', 8 | 'Shader:clone' 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /api/lovr/graphics/ShaderStage.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different shader stages.', 3 | description = [[ 4 | Different shader stages. Graphics shaders have a `vertex` and `fragment` stage, and compute 5 | shaders have a single `compute` stage. 6 | ]], 7 | values = { 8 | { 9 | name = 'vertex', 10 | description = 'The vertex stage, which computes transformed vertex positions.' 11 | }, 12 | { 13 | name = 'fragment', 14 | description = 'The fragment stage, which computes pixel colors.' 15 | }, 16 | { 17 | name = 'compute', 18 | description = 'The compute stage, which performs arbitrary computation.' 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/ShaderType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different types of Shaders.', 3 | description = 'The two types of shaders that can be created.', 4 | values = { 5 | { 6 | name = 'graphics', 7 | description = 'A graphics shader with a vertex and pixel stage.' 8 | }, 9 | { 10 | name = 'compute', 11 | description = 'A compute shader with a single compute stage.' 12 | } 13 | }, 14 | related = { 15 | 'lovr.graphics.newShader', 16 | 'Shader:getType', 17 | 'ShaderStage' 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/graphics/StackType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Types of stacks that can be pushed and popped.', 3 | description = [[ 4 | Different types of stacks that can be pushed and popped with `Pass:push` and `Pass:pop`. 5 | ]], 6 | values = { 7 | { 8 | name = 'transform', 9 | description = 'The transform stack (`Pass:transform`, `Pass:translate`, etc.).' 10 | }, 11 | { 12 | name = 'state', 13 | description = [[ 14 | Graphics state, like `Pass:setColor`, `Pass:setFont`, etc. Notably this does not include 15 | camera poses/projections or shader variables changed with `Pass:send`. 16 | ]] 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getFormat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-metadata', 3 | summary = 'Get the format of the Texture.', 4 | description = 'Returns the format of the texture.', 5 | arguments = {}, 6 | returns = { 7 | format = { 8 | type = 'TextureFormat', 9 | description = 'The format of the Texture.' 10 | }, 11 | linear = { 12 | type = 'boolean', 13 | description = 'Whether the format is linear or srgb.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'format', 'linear' } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-metadata', 3 | summary = 'Get the height of the Texture, in pixels.', 4 | description = 'Returns the height of the Texture, in pixels.', 5 | arguments = {}, 6 | returns = { 7 | height = { 8 | type = 'number', 9 | description = 'The height of the Texture, in pixels.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'height' } 16 | } 17 | }, 18 | related = { 19 | 'Texture:getWidth', 20 | 'Texture:getLayerCount', 21 | 'Texture:getDimensions' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getMipmapCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-metadata', 3 | summary = 'Get the number of mipmap levels in the Texture.', 4 | description = 'Returns the number of mipmap levels in the Texture.', 5 | arguments = {}, 6 | returns = { 7 | mipmaps = { 8 | type = 'number', 9 | description = 'The number of mipmap levels in the Texture.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'mipmaps' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.graphics.newTexture', 20 | 'Sampler:getMipmapRange', 21 | 'Texture:generateMipmaps' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getSampler.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-sampler', 3 | summary = 'Get the Sampler assigned to the Texture.', 4 | description = [[ 5 | Returns the Sampler object previously assigned with `Texture:setSampler`. 6 | 7 | This API is experimental, and subject to change in the future! 8 | ]], 9 | arguments = {}, 10 | returns = { 11 | sampler = { 12 | type = 'Sampler', 13 | description = 'The Sampler object.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'sampler' } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-metadata', 3 | summary = 'Get the type of the Texture.', 4 | description = 'Returns the type of the texture.', 5 | arguments = {}, 6 | returns = { 7 | type = { 8 | type = 'TextureType', 9 | description = 'The type of the Texture.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'type' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/graphics/Texture/getWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'texture-metadata', 3 | summary = 'Get the width of the Texture, in pixels.', 4 | description = 'Returns the width of the Texture, in pixels.', 5 | arguments = {}, 6 | returns = { 7 | width = { 8 | type = 'number', 9 | description = 'The width of the Texture, in pixels.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'width' } 16 | } 17 | }, 18 | related = { 19 | 'Texture:getHeight', 20 | 'Texture:getLayerCount', 21 | 'Texture:getDimensions' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/VerticalAlign.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different ways to vertically align text.', 3 | description = 'Different ways to vertically align text with `Pass:text`.', 4 | values = { 5 | { 6 | name = 'top', 7 | description = 'Top-aligned text.' 8 | }, 9 | { 10 | name = 'middle', 11 | description = 'Centered text.' 12 | }, 13 | { 14 | name = 'bottom', 15 | description = 'Bottom-aligned text.' 16 | } 17 | }, 18 | related = { 19 | 'HorizontalAlign', 20 | 'Pass:text', 21 | 'Font:getVertices' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/graphics/Winding.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different triangle windings.', 3 | description = [[ 4 | Indicates whether the front face of a triangle uses the clockwise or counterclockwise vertex 5 | order. 6 | ]], 7 | values = { 8 | { 9 | name = 'clockwise', 10 | description = 'Clockwise winding.' 11 | }, 12 | { 13 | name = 'counterclockwise', 14 | description = 'Counterclockwise winding.' 15 | } 16 | }, 17 | related = { 18 | 'Pass:setWinding', 19 | 'Pass:setCullMode' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/graphics/getDefaultFont.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'graphics-objects', 3 | summary = 'Get the default Font.', 4 | description = [[ 5 | Returns the default Font. The default font is Varela Round, created at 32px with a spread value 6 | of `4.0`. It's used by `Pass:text` if no Font is provided. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | font = { 11 | type = 'Font', 12 | description = 'The default Font object.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'font' } 19 | } 20 | }, 21 | related = { 22 | 'Pass:text', 23 | 'lovr.graphics.newFont' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/headset/DeviceAxis.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different axes on an input device.', 3 | description = 'Axes on an input device.', 4 | values = { 5 | { 6 | name = 'trigger', 7 | description = 'A trigger (1D).' 8 | }, 9 | { 10 | name = 'thumbstick', 11 | description = 'A thumbstick (2D).' 12 | }, 13 | { 14 | name = 'touchpad', 15 | description = 'A touchpad (2D).' 16 | }, 17 | { 18 | name = 'grip', 19 | description = 'A grip button or grab gesture (1D).' 20 | } 21 | }, 22 | related = { 23 | 'lovr.headset.getAxis', 24 | 'DeviceButton' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/headset/FoveationLevel.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different foveation levels.', 3 | description = 'The different levels of foveation supported by `lovr.headset.setFoveation`.', 4 | values = { 5 | { 6 | name = 'low', 7 | description = 'Low foveation.' 8 | }, 9 | { 10 | name = 'medium', 11 | description = 'Medium foveation.' 12 | }, 13 | { 14 | name = 'high', 15 | description = 'High foveation.' 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/headset/HeadsetDriver.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'VR APIs.', 3 | description = [[ 4 | These are all of the supported VR APIs that LÖVR can use to power the lovr.headset module. You 5 | can change the order of headset drivers using `lovr.conf` to prefer or exclude specific VR APIs. 6 | 7 | At startup, LÖVR searches through the list of drivers in order. 8 | ]], 9 | values = { 10 | { 11 | name = 'simulator', 12 | description = 'A VR simulator using keyboard/mouse.' 13 | }, 14 | { 15 | name = 'openxr', 16 | description = 'OpenXR.' 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/headset/HeadsetOrigin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Different types of coordinate space origins.', 3 | description = [[ 4 | Represents the different types of origins for coordinate spaces. An origin of "floor" means 5 | that the origin is on the floor in the middle of a room-scale play area. An origin of "head" 6 | means that no positional tracking is available, and consequently the origin is always at the 7 | position of the headset. 8 | ]], 9 | values = { 10 | { 11 | name = 'head', 12 | description = 'The origin is at the head.' 13 | }, 14 | { 15 | name = 'floor', 16 | description = 'The origin is on the floor.' 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/headset/getBoundsDepth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'playArea', 3 | summary = 'Get the depth of the play area.', 4 | description = 'Returns the depth of the play area, in meters.', 5 | arguments = {}, 6 | returns = { 7 | depth = { 8 | type = 'number', 9 | description = 'The depth of the play area, in meters.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'depth' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getBoundsWidth', 20 | 'lovr.headset.getBoundsDimensions' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/getBoundsWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'playArea', 3 | summary = 'Get the width of the play area.', 4 | description = 'Returns the width of the play area, in meters.', 5 | arguments = {}, 6 | returns = { 7 | width = { 8 | type = 'number', 9 | description = 'The width of the play area, in meters.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'width' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getBoundsDepth', 20 | 'lovr.headset.getBoundsDimensions' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/getDisplayFrequency.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'headset', 4 | summary = 'Get the refresh rate of the display.', 5 | description = 'Returns the refresh rate of the headset display, in Hz.', 6 | arguments = {}, 7 | returns = { 8 | frequency = { 9 | type = 'number', 10 | description = 'The frequency of the display, or `nil` if I have no idea what it is.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'frequency' } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/headset/getDisplayHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset', 3 | summary = 'Get the height of the headset display.', 4 | description = 'Returns the height of the headset display (for one eye), in pixels.', 5 | arguments = {}, 6 | returns = { 7 | height = { 8 | type = 'number', 9 | description = 'The height of the display.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'height' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getDisplayWidth', 20 | 'lovr.headset.getDisplayDimensions' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/getDisplayWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset', 3 | summary = 'Get the width of the headset display.', 4 | description = 'Returns the width of the headset display (for one eye), in pixels.', 5 | arguments = {}, 6 | returns = { 7 | width = { 8 | type = 'number', 9 | description = 'The width of the display.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'width' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getDisplayHeight', 20 | 'lovr.headset.getDisplayDimensions' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/getName.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset-misc', 3 | summary = 'Get the name of the connected headset display.', 4 | description = [[ 5 | Returns the name of the headset as a string. The exact string that is returned depends on the 6 | hardware and VR SDK that is currently in use. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | name = { 11 | type = 'string', 12 | description = 'The name of the headset as a string.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'name' } 19 | } 20 | }, 21 | notes = 'The simulator driver name will always be `Simulator`.' 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/getOriginType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | tag = 'playArea', 4 | summary = 'Get the type of tracking origin of the headset.', 5 | description = [[ 6 | Returns the type of origin used for the tracking volume. The different types of origins are 7 | explained on the `HeadsetOrigin` page. 8 | ]], 9 | arguments = {}, 10 | returns = { 11 | origin = { 12 | type = 'HeadsetOrigin', 13 | description = 'The type of origin.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'origin' } 20 | } 21 | }, 22 | related = { 23 | 'HeadsetOrigin' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/headset/getPassthrough.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset', 3 | summary = 'Get the current passthrough mode.', 4 | description = 'Returns the current passthrough mode.', 5 | arguments = {}, 6 | returns = { 7 | mode = { 8 | type = 'PassthroughMode', 9 | description = 'The current passthrough mode.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'mode' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getPassthroughModes' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/headset/getRefreshRate.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset', 3 | summary = 'Get the refresh rate of the headset display.', 4 | description = 'Returns the refresh rate of the headset display, in Hz.', 5 | arguments = {}, 6 | returns = { 7 | rate = { 8 | type = 'number', 9 | description = 'The refresh rate of the display, or `nil` if I have no idea what it is.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'rate' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.headset.getRefreshRates' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/headset/isFocused.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset-misc', 3 | summary = 'Check if LÖVR has VR input focus.', 4 | description = [[ 5 | Returns whether LÖVR has VR input focus. Focus is lost when the VR system menu is shown. The 6 | `lovr.focus` callback can be used to detect when this changes. 7 | ]], 8 | arguments = {}, 9 | returns = { 10 | focused = { 11 | type = 'boolean', 12 | description = 'Whether the application is focused.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'focused' } 19 | } 20 | }, 21 | related = { 22 | 'lovr.focus' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/headset/start.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset-misc', 3 | summary = 'Starts the headset session.', 4 | description = [[ 5 | Starts the headset session. This must be called after the graphics module is initialized. 6 | Normally it is called automatically by `boot.lua`, but this can be disabled by setting 7 | `t.headset.start` to false in `lovr.conf`. 8 | ]], 9 | arguments = {}, 10 | returns = {}, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = {} 15 | } 16 | }, 17 | related = { 18 | 'lovr.headset.stop', 19 | 'lovr.headset.isActive' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/headset/stopVibration.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'input', 3 | summary = 'Stop vibration on a device.', 4 | description = 'Causes the device to stop any active haptics vibration.', 5 | arguments = { 6 | device = { 7 | type = 'Device', 8 | default = [['head']], 9 | description = 'The device to stop the vibration on.' 10 | } 11 | }, 12 | returns = {}, 13 | variants = { 14 | { 15 | arguments = { 'device' }, 16 | returns = {} 17 | } 18 | }, 19 | related = { 20 | 'lovr.headset.vibrate' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/headset/submit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset-misc', 3 | summary = 'Submit a frame to the headset display.', 4 | description = [[ 5 | Submits the current headset texture to the VR display. This should be called after calling 6 | `lovr.graphics.submit` with the headset render pass. Normally this is taken care of by 7 | `lovr.run`. 8 | ]], 9 | arguments = {}, 10 | returns = {}, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = {} 15 | } 16 | }, 17 | related = { 18 | 'lovr.headset.getPass', 19 | 'lovr.headset.getTexture' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/headset/update.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'headset-misc', 3 | summary = 'Update the headset module.', 4 | description = [[ 5 | Updates the headset module, blocking until it is time to start a new frame and polling new input 6 | states. This should only be called once at the beginning of a frame, and is normally taken care 7 | of by the default `lovr.run` implementation. 8 | ]], 9 | arguments = {}, 10 | returns = {}, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = {} 15 | } 16 | }, 17 | related = { 18 | 'lovr.headset.submit' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/math/Curve/getPointCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of control points in the Curve.', 3 | description = [[ 4 | Returns the number of control points in the Curve. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | count = { 9 | type = 'number', 10 | description = 'The number of control points.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'count' } 17 | } 18 | }, 19 | related = { 20 | 'Curve:getPoint', 21 | 'Curve:setPoint', 22 | 'Curve:addPoint', 23 | 'Curve:removePoint' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/math/Mat4/equals.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if a matrix equals another matrix.', 3 | description = 'Returns whether a matrix is approximately equal to another matrix.', 4 | arguments = { 5 | n = { 6 | type = 'Mat4', 7 | description = 'The other matrix.' 8 | } 9 | }, 10 | returns = { 11 | equal = { 12 | type = 'boolean', 13 | description = 'Whether the 2 matrices approximately equal each other.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'n' }, 19 | returns = { 'equal' } 20 | } 21 | }, 22 | related = { 23 | 'Vec2:equals', 24 | 'Vec3:equals', 25 | 'Vec4:equals', 26 | 'Quat:equals' 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/lovr/math/Mat4/identity.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Reset the matrix to the identity.', 3 | description = [[ 4 | Resets the matrix to the identity, effectively setting its translation to zero, its scale to 1, 5 | and clearing any rotation. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | self = { 10 | type = 'Mat4', 11 | description = 'The modified matrix.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'self' } 18 | } 19 | }, 20 | related = { 21 | 'Pass:origin' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/math/Mat4/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A 4x4 matrix.', 3 | description = 'A `mat4` is a math type that holds 16 values in a 4x4 grid.', 4 | constructors = { 5 | 'lovr.math.newMat4', 6 | 'lovr.math.mat4' 7 | }, 8 | related = { 9 | 'Vec3', 10 | 'Quat', 11 | 'Vectors' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/math/Mat4/invert.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Invert the matrix.', 3 | description = 'Inverts the matrix, causing it to represent the opposite of its old transform.', 4 | arguments = {}, 5 | returns = { 6 | self = { 7 | type = 'Mat4', 8 | description = 'The inverted matrix.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'self' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/math/Mat4/transpose.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Transpose the matrix.', 3 | description = 'Transposes the matrix, mirroring its values along the diagonal.', 4 | arguments = {}, 5 | returns = { 6 | self = { 7 | type = 'Mat4', 8 | description = 'The transposed matrix.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'self' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/math/Quat/conjugate.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Conjugate (invert) the quaternion.', 3 | description = [[ 4 | Conjugates the input quaternion in place, returning the input. If the quaternion is normalized, 5 | this is the same as inverting it. It negates the (x, y, z) components of the quaternion. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | self = { 10 | type = 'Quat', 11 | description = 'The inverted quaternion.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'self' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/math/Quat/direction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the direction of the quaternion.', 3 | description = [[ 4 | Creates a new temporary vec3 facing the forward direction, rotates it by this quaternion, and 5 | returns the vector. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | v = { 10 | type = 'Vec3', 11 | description = 'The direction vector.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'v' } 18 | } 19 | }, 20 | related = { 21 | 'Mat4:lookAt' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/math/Quat/getEuler.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the euler angles of the quaternion.', 3 | description = 'Returns the euler angles of the quaternion, in YXZ order.', 4 | arguments = {}, 5 | returns = { 6 | pitch = { 7 | type = 'number', 8 | description = 'The pitch (x axis rotation).' 9 | }, 10 | yaw = { 11 | type = 'number', 12 | description = 'The yaw (y axis rotation).' 13 | }, 14 | roll = { 15 | type = 'number', 16 | description = 'The roll (z axis rotation).' 17 | } 18 | }, 19 | variants = { 20 | { 21 | arguments = {}, 22 | returns = { 'pitch', 'yaw', 'roll' } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/math/Quat/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A quaternion.', 3 | description = 'A `quat` is a math type that represents a 3D rotation, stored as four numbers.', 4 | constructors = { 5 | 'lovr.math.newQuat', 6 | 'lovr.math.quat' 7 | }, 8 | related = { 9 | 'Vec3', 10 | 'Mat4', 11 | 'Vectors' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/math/Quat/length.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the quaternion.', 3 | description = 'Returns the length of the quaternion.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the quaternion.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | related = { 18 | 'Quat:normalize' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/math/RandomGenerator/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A pseudo-random number generator.', 3 | description = [[ 4 | A RandomGenerator is a standalone object that can be used to independently generate 5 | pseudo-random numbers. If you just need basic randomness, you can use `lovr.math.random` without 6 | needing to create a random generator. 7 | ]], 8 | constructor = 'lovr.math.newRandomGenerator' 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/math/Vec2/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A 2D vector.', 3 | description = 'A vector object that holds two numbers.', 4 | constructors = { 5 | 'lovr.math.newVec2', 6 | 'lovr.math.vec2' 7 | }, 8 | related = { 9 | 'Vec3', 10 | 'Vec4', 11 | 'Vectors' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/math/Vec2/length.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the vector.', 3 | description = 'Returns the length of the vector.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the vector.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | notes = [[ 18 | The length is equivalent to this: 19 | 20 | math.sqrt(v.x * v.x + v.y * v.y) 21 | ]], 22 | related = { 23 | 'Vec2:normalize', 24 | 'Vec2:distance' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/math/Vec2/normalize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Normalize the length of the vector to 1.', 3 | description = [[ 4 | Adjusts the values in the vector so that its direction stays the same but its length becomes 1. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | self = { 9 | type = 'Vec2', 10 | description = 'The normalized vector.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'self' } 17 | } 18 | }, 19 | related = { 20 | 'Vec2:length' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/math/Vec2/unpack.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the components of the vector.', 3 | description = 'Returns the 2 components of the vector as numbers.', 4 | arguments = {}, 5 | returns = { 6 | x = { 7 | type = 'number', 8 | description = 'The x value.' 9 | }, 10 | y = { 11 | type = 'number', 12 | description = 'The y value.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'x', 'y' } 19 | } 20 | }, 21 | related = { 22 | 'Vec2:set' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/math/Vec3/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A 3D vector.', 3 | description = 'A vector object that holds three numbers.', 4 | constructors = { 5 | 'lovr.math.newVec3', 6 | 'lovr.math.vec3' 7 | }, 8 | related = { 9 | 'Vec2', 10 | 'Vec4', 11 | 'Vectors' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/math/Vec3/length.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the vector.', 3 | description = 'Returns the length of the vector.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the vector.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | notes = [[ 18 | The length is equivalent to this: 19 | 20 | math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z) 21 | ]], 22 | related = { 23 | 'Vec3:normalize', 24 | 'Vec3:distance' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/math/Vec3/normalize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Normalize the length of the vector to 1.', 3 | description = [[ 4 | Adjusts the values in the vector so that its direction stays the same but its length becomes 1. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | self = { 9 | type = 'Vec3', 10 | description = 'The normalized vector.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'self' } 17 | } 18 | }, 19 | related = { 20 | 'Vec3:length' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/math/Vec3/unpack.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the components of the vector.', 3 | description = 'Returns the 3 components of the vector as numbers.', 4 | arguments = {}, 5 | returns = { 6 | x = { 7 | type = 'number', 8 | description = 'The x value.' 9 | }, 10 | y = { 11 | type = 'number', 12 | description = 'The y value.' 13 | }, 14 | z = { 15 | type = 'number', 16 | description = 'The z value.' 17 | } 18 | }, 19 | variants = { 20 | { 21 | arguments = {}, 22 | returns = { 'x', 'y', 'z' } 23 | } 24 | }, 25 | related = { 26 | 'Vec3:set' 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/lovr/math/Vec4/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A 4D vector.', 3 | description = 'A vector object that holds four numbers.', 4 | constructors = { 5 | 'lovr.math.newVec4', 6 | 'lovr.math.vec4' 7 | }, 8 | related = { 9 | 'Vec2', 10 | 'Vec3', 11 | 'Vectors' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/math/Vec4/length.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the vector.', 3 | description = 'Returns the length of the vector.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the vector.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | notes = [[ 18 | The length is equivalent to this: 19 | 20 | math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w) 21 | ]], 22 | related = { 23 | 'Vec4:normalize', 24 | 'Vec4:distance' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/math/Vec4/normalize.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Normalize the length of the vector to 1.', 3 | description = [[ 4 | Adjusts the values in the vector so that its direction stays the same but its length becomes 1. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | self = { 9 | type = 'Vec4', 10 | description = 'The normalized vector.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'self' } 17 | } 18 | }, 19 | related = { 20 | 'Vec4:length' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/math/drain.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'vectors', 3 | summary = 'Drain the temporary vector pool.', 4 | description = [[ 5 | Drains the temporary vector pool, invalidating existing temporary vectors. 6 | 7 | This is called automatically at the end of each frame. 8 | ]], 9 | arguments = {}, 10 | returns = {}, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = {} 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/math/getRandomSeed.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'random', 3 | summary = 'Get the random seed.', 4 | description = 'Get the seed used to initialize the random generator.', 5 | arguments = {}, 6 | returns = { 7 | seed = { 8 | type = 'number', 9 | description = 'The new seed.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'seed' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/math/setRandomSeed.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'random', 3 | summary = 'Set the random seed.', 4 | description = [[ 5 | Seed the random generator with a new seed. Each seed will cause `lovr.math.random` and 6 | `lovr.math.randomNormal` to produce a unique sequence of random numbers. This is done once 7 | automatically at startup by `lovr.run`. 8 | ]], 9 | arguments = { 10 | seed = { 11 | type = 'number', 12 | description = 'The new seed.' 13 | } 14 | }, 15 | returns = {}, 16 | variants = { 17 | { 18 | arguments = { 'seed' }, 19 | returns = {} 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/physics/BallJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A ball and socket joint.', 3 | description = [[ 4 | A BallJoint is a type of `Joint` that acts like a ball and socket between two colliders. It 5 | allows the colliders to rotate freely around an anchor point, but does not allow the colliders' 6 | distance from the anchor point to change. 7 | ]], 8 | extends = 'Joint', 9 | constructors = { 10 | 'lovr.physics.newBallJoint' 11 | }, 12 | related = { 13 | 'Collider' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/physics/BoxShape/getDimensions.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the dimensions of the BoxShape.', 3 | description = 'Returns the width, height, and depth of the BoxShape.', 4 | arguments = {}, 5 | returns = { 6 | width = { 7 | type = 'number', 8 | description = 'The width of the box, in meters.' 9 | }, 10 | height = { 11 | type = 'number', 12 | description = 'The height of the box, in meters.' 13 | }, 14 | depth = { 15 | type = 'number', 16 | description = 'The depth of the box, in meters.' 17 | } 18 | }, 19 | variants = { 20 | { 21 | arguments = {}, 22 | returns = { 'width', 'height', 'depth' } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/physics/BoxShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A box Shape.', 3 | description = 'A type of `Shape` that can be used for cubes or boxes.', 4 | extends = 'Shape', 5 | constructors = { 6 | 'lovr.physics.newBoxShape', 7 | 'World:newBoxCollider' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/physics/CapsuleShape/getLength.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the CapsuleShape.', 3 | description = 'Returns the length of the CapsuleShape, not including the caps.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the capsule, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | related = { 18 | 'CapsuleShape:getRadius', 19 | 'CapsuleShape:setRadius' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/CapsuleShape/getRadius.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the radius of the CapsuleShape.', 3 | description = 'Returns the radius of the CapsuleShape.', 4 | arguments = {}, 5 | returns = { 6 | radius = { 7 | type = 'number', 8 | description = 'The radius of the capsule, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'radius' } 15 | } 16 | }, 17 | related = { 18 | 'CapsuleShape:getLength', 19 | 'CapsuleShape:setLength' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/CapsuleShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A capsule Shape.', 3 | description = 'A type of `Shape` that can be used for capsule-shaped things.', 4 | extends = 'Shape', 5 | constructors = { 6 | 'lovr.physics.newCapsuleShape', 7 | 'World:newCapsuleCollider' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/destroy.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Destroy the Collider.', 3 | description = [[ 4 | Destroys the Collider, removing it from the World and destroying all Shapes and Joints attached 5 | to it. 6 | ]], 7 | arguments = {}, 8 | returns = {}, 9 | variants = { 10 | { 11 | arguments = {}, 12 | returns = {} 13 | } 14 | }, 15 | notes = [[ 16 | After a Collider is destroyed, calling methods on it or passing it to a function will throw an 17 | error. 18 | ]], 19 | related = { 20 | 'Collider:isDestroyed', 21 | 'Collider:setEnabled', 22 | 'World:destroy', 23 | 'Shape:destroy', 24 | 'Joint:destroy' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/getJoints.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a list of Joints attached to the Collider.', 3 | description = 'Returns a list of Joints attached to the Collider.', 4 | arguments = {}, 5 | returns = { 6 | joints = { 7 | type = 'table', 8 | description = 'A list of `Joint` objects attached to the Collider.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'joints' } 15 | } 16 | }, 17 | related = { 18 | 'World:getJoints', 19 | 'Joint:getColliders', 20 | 'Joint:destroy' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/getShapes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a list of Shapes attached to the Collider.', 3 | description = 'Returns a list of Shapes attached to the Collider.', 4 | arguments = {}, 5 | returns = { 6 | shapes = { 7 | type = 'table', 8 | description = 'A list of `Shape` objects attached to the Collider.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'shapes' } 15 | } 16 | }, 17 | related = { 18 | 'Collider:getShape', 19 | 'Collider:addShape', 20 | 'Collider:removeShape', 21 | 'Shape' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/getWorld.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the World the Collider is in.', 3 | description = 'Returns the World the Collider is in.', 4 | arguments = {}, 5 | returns = { 6 | world = { 7 | type = 'World', 8 | description = 'The World the Collider is in.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'world' } 15 | } 16 | }, 17 | notes = 'Colliders can only ever be in the World that created them.' 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/isAwake.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the Collider is awake.', 3 | description = 'Returns whether the Collider is awake.', 4 | arguments = {}, 5 | returns = { 6 | awake = { 7 | type = 'boolean', 8 | description = 'Whether the Collider is finally awake.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'awake' } 15 | } 16 | }, 17 | notes = 'See `Collider:setSleepingAllowed` for notes about sleeping.', 18 | related = { 19 | 'Collider:isSleepingAllowed', 20 | 'Collider:setSleepingAllowed' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/isGravityIgnored.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | summary = 'Check if the Collider ignores gravity.', 4 | description = 'Returns whether the Collider is currently ignoring gravity.', 5 | arguments = {}, 6 | returns = { 7 | ignored = { 8 | type = 'boolean', 9 | description = 'Whether gravity is ignored for this Collider.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'ignored' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/moveKinematic.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'TODO', 3 | description = 'TODO', 4 | arguments = { 5 | -- 6 | }, 7 | returns = {}, 8 | variants = { 9 | { 10 | arguments = {}, 11 | returns = {} 12 | } 13 | }, 14 | notes = [[ 15 | 16 | ]], 17 | related = { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/physics/Collider/setGravityIgnored.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | summary = 'Set whether the Collider ignores gravity.', 4 | description = 'Sets whether the Collider should ignore gravity.', 5 | arguments = { 6 | ignored = { 7 | type = 'boolean', 8 | description = 'Whether gravity should be ignored.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'ignored' }, 15 | returns = {} 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/physics/ConeJoint/getLimit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the angle limit of the ConeJoint.', 3 | description = [[ 4 | Returns the angle limit of the ConeJoint. The relative angle between the ConeJoint's axis and 5 | the second Collider will be constrained to this limit. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | limit = { 10 | type = 'number', 11 | description = 'The angle limit, in radians.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'limit' } 18 | } 19 | }, 20 | notes = 'The default limit is zero, preventing any rotation away from the axis.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/ConeJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'TODO', 3 | description = 'TODO', 4 | extends = 'Joint' 5 | } 6 | -------------------------------------------------------------------------------- /api/lovr/physics/ConeJoint/setLimit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the angle limit of the ConeJoint.', 3 | description = [[ 4 | Sets the angle limit of the ConeJoint. The relative angle between the ConeJoint's axis and 5 | the second Collider will be constrained to this limit. 6 | ]], 7 | arguments = { 8 | limit = { 9 | type = 'number', 10 | description = 'The new limit in radians, between 0 and pi.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'limit' }, 17 | returns = {} 18 | } 19 | }, 20 | notes = 'The default limit is zero, preventing any rotation away from the axis.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/getColliders.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the two Colliders that are in contact.', 3 | description = 'Returns the two Colliders that are in contact.', 4 | arguments = {}, 5 | returns = { 6 | first = { 7 | type = 'Collider', 8 | description = 'The first collider.' 9 | }, 10 | second = { 11 | type = 'Collider', 12 | description = 'The second collider.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'first', 'second' } 19 | } 20 | }, 21 | related = { 22 | 'Contact:getShapes' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/getFriction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the friction of the Contact.', 3 | description = [[ 4 | Returns the friction of the Contact. Lower friction makes it easier for the colliders to slide 5 | against each other. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | friction = { 10 | type = 'number', 11 | description = 'The contact friction.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'friction' } 18 | } 19 | }, 20 | related = { 21 | 'Collider:getFriction', 22 | 'Collider:setFriction', 23 | 'Contact:getRestitution', 24 | 'Contact:setRestitution' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/getOverlap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the amount of overlap between the colliders.', 3 | description = 'Returns the amount of overlap between the colliders.', 4 | arguments = {}, 5 | returns = { 6 | overlap = { 7 | type = 'number', 8 | description = 'The amount of overlap, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'overlap' } 15 | } 16 | }, 17 | related = { 18 | 'Contact:getNormal' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/getPoints.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the contact points of the Contact.', 3 | description = [[ 4 | Returns the contact points of the Contact. These are the points where the colliders are 5 | intersecting. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | ['...points'] = { 10 | type = 'number', 11 | description = 'Triplets of x/y/z numbers, one for each contact point.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { '...points' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/getShapes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the two Shapes that are in contact.', 3 | description = 'Returns the two Shapes that are in contact.', 4 | arguments = {}, 5 | returns = { 6 | first = { 7 | type = 'Shape', 8 | description = 'The first shape.' 9 | }, 10 | second = { 11 | type = 'Shape', 12 | description = 'The second shape.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'first', 'second' } 19 | } 20 | }, 21 | related = { 22 | 'Contact:getColliders' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/Contact/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'TODO', 3 | description = 'TODO' 4 | } 5 | -------------------------------------------------------------------------------- /api/lovr/physics/ConvexShape/getFaceCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of faces in the convex hull.', 3 | description = 'Returns the number of faces in the convex hull.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of faces.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | related = { 18 | 'ConvexShape:getFace' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/physics/ConvexShape/getPointCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of points in the convex hull.', 3 | description = 'Returns the number of points in the convex hull.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of points.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | }, 17 | notes = [[ 18 | This isn't necessarily the same as the number of points or vertices that were used to create the 19 | shape, since points inside the hull will be discarded. 20 | ]], 21 | related = { 22 | 'ConvexShape:getPoint' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/ConvexShape/getScale.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the scale the ConvexShape was created with.', 3 | description = 'Returns the scale the ConvexShape was created with.', 4 | arguments = {}, 5 | returns = { 6 | scale = { 7 | type = 'number', 8 | description = 'The scale.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'scale' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.physics.newConvexShape', 19 | 'World:newConvexCollider' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/CylinderShape/getLength.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the length of the CylinderShape.', 3 | description = 'Returns the length of the CylinderShape.', 4 | arguments = {}, 5 | returns = { 6 | length = { 7 | type = 'number', 8 | description = 'The length of the cylinder, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'length' } 15 | } 16 | }, 17 | related = { 18 | 'CylinderShape:getRadius', 19 | 'CylinderShape:setRadius' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/CylinderShape/getRadius.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the radius of the CylinderShape.', 3 | description = 'Returns the radius of the CylinderShape.', 4 | arguments = {}, 5 | returns = { 6 | radius = { 7 | type = 'number', 8 | description = 'The radius of the cylinder, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'radius' } 15 | } 16 | }, 17 | related = { 18 | 'CylinderShape:getLength', 19 | 'CylinderShape:setLength' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/CylinderShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A cylinder Shape.', 3 | description = 'A type of `Shape` that can be used for cylinder-shaped things.', 4 | extends = 'Shape', 5 | constructors = { 6 | 'lovr.physics.newCylinderShape', 7 | 'World:newCylinderCollider' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/physics/DistanceJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A fixed distance joint.', 3 | description = [[ 4 | A DistanceJoint is a type of `Joint` that tries to keep two colliders within a certain distance. 5 | The distance is determined by the initial distance between the anchor points. The joint allows 6 | for rotation on the anchor points. 7 | ]], 8 | extends = 'Joint', 9 | constructors = { 10 | 'lovr.physics.newDistanceJoint' 11 | }, 12 | related = { 13 | 'Collider' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/physics/HingeJoint/getAngle.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the current angle of the HingeJoint.', 3 | description = 'Returns the current angle of the HingeJoint, relative to the rest position.', 4 | arguments = {}, 5 | returns = { 6 | angle = { 7 | type = 'number', 8 | description = 'The hinge angle, in radians.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'angle' } 15 | } 16 | }, 17 | related = { 18 | 'HingeJoint:getAxis', 19 | 'HingeJoint:getLimits', 20 | 'HingeJoint:setLimits' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/physics/HingeJoint/getFriction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the friction of the HingeJoint.', 3 | description = [[ 4 | Returns the friction of the HingeJoint. This is a maximum torque force that will be applied, in 5 | newton meters. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | friction = { 10 | type = 'number', 11 | description = 'The friction, in newton meters.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'friction' } 18 | } 19 | }, 20 | notes = 'Friction is only applied when the motor is disabled.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/HingeJoint/getMotorTorque.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the current motor torque.', 3 | description = [[ 4 | Returns the current torque the motor is using to reach its target, in newton meters. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | torque = { 9 | type = 'number', 10 | description = 'The current torque, in newton meters.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'torque' } 17 | } 18 | }, 19 | related = { 20 | 'HingeJoint:getMaxMotorTorque', 21 | 'HingeJoint:setMaxMotorTorque' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/HingeJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A hinge joint.', 3 | description = [[ 4 | A HingeJoint is a type of `Joint` that only allows colliders to rotate on a single axis. 5 | ]], 6 | extends = 'Joint', 7 | constructors = { 8 | 'lovr.physics.newHingeJoint' 9 | }, 10 | related = { 11 | 'Collider' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/physics/HingeJoint/setFriction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the friction of the HingeJoint.', 3 | description = [[ 4 | Sets the friction of the HingeJoint. This is a maximum torque force that will be applied, in 5 | newton meters. 6 | ]], 7 | arguments = { 8 | friction = { 9 | type = 'number', 10 | description = 'The friction, in newton meters.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'friction' }, 17 | returns = {} 18 | } 19 | }, 20 | notes = 'Friction is only applied when the motor is disabled.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/getColliders.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the Colliders the Joint is attached to.', 3 | description = 'Returns the Colliders the Joint is attached to.', 4 | arguments = {}, 5 | returns = { 6 | colliderA = { 7 | type = 'Collider', 8 | description = 'The first Collider.' 9 | }, 10 | colliderB = { 11 | type = 'Collider', 12 | description = 'The second Collider.' 13 | } 14 | }, 15 | variants = { 16 | { 17 | arguments = {}, 18 | returns = { 'colliderA', 'colliderB' } 19 | } 20 | }, 21 | related = { 22 | 'Collider:getJoints' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/getPriority.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the priority of the Joint.', 3 | description = [[ 4 | Returns the priority of the Joint. Joints with a higher priority are more likely to be solved 5 | correctly. Priority values are non-negative integers. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | priority = { 10 | type = 'number', 11 | description = 'The integer priority value.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'priority' } 18 | } 19 | }, 20 | notes = 'The default priority is zero.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/getType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the type of the Joint.', 3 | description = 'Returns the type of the Joint.', 4 | arguments = {}, 5 | returns = { 6 | type = { 7 | type = 'JointType', 8 | description = 'The type of the Joint.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'type' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Joins two Colliders together.', 3 | description = 'A Joint is a physics object that constrains the movement of two Colliders.', 4 | constructors = { 5 | 'lovr.physics.newWeldJoint', 6 | 'lovr.physics.newBallJoint', 7 | 'lovr.physics.newConeJoint', 8 | 'lovr.physics.newDistanceJoint', 9 | 'lovr.physics.newHingeJoint', 10 | 'lovr.physics.newSliderJoint' 11 | }, 12 | related = { 13 | 'Collider' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/setEnabled.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Enable or disable the Joint.', 3 | description = [[ 4 | Enable or disable the Joint. Disabled joints do not affect the simulation in any way. If the 5 | Joint is no longer needed, `Joint:destroy` is a better option that completely removes the Joint 6 | from the simulation. 7 | ]], 8 | arguments = { 9 | enabled = { 10 | type = 'boolean', 11 | description = 'Whether the Joint should be enabled.' 12 | } 13 | }, 14 | returns = {}, 15 | variants = { 16 | { 17 | arguments = { 'enabled' }, 18 | returns = {} 19 | } 20 | }, 21 | related = { 22 | 'Joint:destroy' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/Joint/setPriority.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the priority of the Joint.', 3 | description = [[ 4 | Sets the priority of the Joint. Joints with a higher priority are more likely to be solved 5 | correctly. Priority values are non-negative integers. 6 | ]], 7 | arguments = { 8 | priority = { 9 | type = 'number', 10 | description = 'The integer priority value.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'priority' }, 17 | returns = {} 18 | } 19 | }, 20 | notes = 'The default priority is zero.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/JointType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Types of physics joints.', 3 | description = [[ 4 | Represents the different types of physics Joints available. 5 | ]], 6 | values = { 7 | { 8 | name = 'ball', 9 | description = 'A BallJoint.' 10 | }, 11 | { 12 | name = 'distance', 13 | description = 'A DistanceJoint.' 14 | }, 15 | { 16 | name = 'hinge', 17 | description = 'A HingeJoint.' 18 | }, 19 | { 20 | name = 'slider', 21 | description = 'A SliderJoint.' 22 | } 23 | }, 24 | related = { 25 | 'Joint', 26 | 'BallJoint', 27 | 'DistanceJoint', 28 | 'HingeJoint', 29 | 'SliderJoint' 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /api/lovr/physics/MeshShape/getScale.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the scale the MeshShape was created with.', 3 | description = 'Returns the scale the MeshShape was created with.', 4 | arguments = {}, 5 | returns = { 6 | scale = { 7 | type = 'number', 8 | description = 'The scale.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'scale' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.physics.newMeshShape', 19 | 'World:newMeshCollider' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/MeshShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A mesh Shape.', 3 | description = 'A type of `Shape` that can be used for triangle meshes.', 4 | extends = 'Shape', 5 | notes = [[ 6 | If a `Collider` contains a MeshShape, it will be forced to become kinematic. `ConvexShape` can 7 | be used instead for dynamic mesh colliders. 8 | ]], 9 | constructors = { 10 | 'lovr.physics.newMeshShape', 11 | 'World:newMeshCollider' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/physics/MotorMode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'The different states for joint motors.', 3 | description = 'The different ways the motor on a joint can be used.', 4 | values = { 5 | { 6 | name = 'position', 7 | description = 'The motor drives to a particular value.' 8 | }, 9 | { 10 | name = 'velocity', 11 | description = 'The motor drives to a particular speed.' 12 | } 13 | }, 14 | related = { 15 | 'HingeJoint:setMotorMode', 16 | 'SliderJoint:setMotorMode' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/physics/Shape/destroy.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Destroy the Shape.', 3 | description = 'Destroys the Shape, removing it from the Collider it\'s attached to.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | }, 12 | notes = [[ 13 | Calling methods on the Shape after destroying it will error (except for `Shape:isDestroyed`). 14 | 15 | If the Shape is attached to a Collider with automatic mass enabled, the collider's mass 16 | properties will update. 17 | ]], 18 | related = { 19 | 'Shape:isDestroyed', 20 | 'Collider:destroy', 21 | 'Joint:destroy', 22 | 'World:destroy' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/physics/Shape/getType.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the type of the Shape.', 3 | description = 'Returns the type of the Shape.', 4 | arguments = {}, 5 | returns = { 6 | type = { 7 | type = 'ShapeType', 8 | description = 'The type of the Shape.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'type' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/physics/Shape/getVolume.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the volume of the Shape.', 3 | description = 'Returns the volume of the Shape, in cubic meters.', 4 | arguments = {}, 5 | returns = { 6 | volume = { 7 | type = 'number', 8 | description = 'The volume of the shape, in cubic meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'volume' } 15 | } 16 | }, 17 | notes = [[ 18 | `MeshShape` and `TerrainShape` do not have volume, and will return 0. 19 | ]], 20 | related = { 21 | 'Shape:getDensity', 22 | 'Shape:setDensity', 23 | 'Shape:getMass', 24 | 'Shape:getAABB' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/physics/Shape/isDestroyed.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the Shape is destroyed.', 3 | description = [[ 4 | Returns whether the Shape has been destroyed. Destroyed shapes can not be used for anything. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | destroyed = { 9 | type = 'boolean', 10 | description = 'Whether the Shape has been destroyed.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'destroyed' } 17 | } 18 | }, 19 | related = { 20 | 'Shape:destroy', 21 | 'Collider:isDestroyed', 22 | 'Joint:isDestroyed', 23 | 'World:isDestroyed' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/physics/SliderJoint/getFriction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the friction of the SliderJoint.', 3 | description = [[ 4 | Returns the friction of the SliderJoint. This is a maximum friction force that will be applied, 5 | in newtons, opposing movement along the slider axis. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | friction = { 10 | type = 'number', 11 | description = 'The maximum friction force, in newtons.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'friction' } 18 | } 19 | }, 20 | notes = 'Friction is only applied when the motor is disabled.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/SliderJoint/getMotorForce.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the current motor force.', 3 | description = [[ 4 | Returns the current force the motor is using to reach its target, in newtons. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | force = { 9 | type = 'number', 10 | description = 'The current force, in newtons.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'force' } 17 | } 18 | }, 19 | related = { 20 | 'SliderJoint:getMaxMotorForce', 21 | 'SliderJoint:setMaxMotorForce' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/SliderJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A slider joint.', 3 | description = [[ 4 | A SliderJoint is a type of `Joint` that only allows colliders to move on a single axis. 5 | ]], 6 | extends = 'Joint', 7 | constructors = { 8 | 'lovr.physics.newSliderJoint' 9 | }, 10 | related = { 11 | 'Collider' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /api/lovr/physics/SliderJoint/setFriction.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Set the friction of the SliderJoint.', 3 | description = [[ 4 | Sets the friction of the SliderJoint. This is a maximum friction force that will be applied, in 5 | newtons, opposing movement along the slider axis. 6 | ]], 7 | arguments = { 8 | friction = { 9 | type = 'number', 10 | description = 'The maximum friction force, in newtons.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'friction' }, 17 | returns = {} 18 | } 19 | }, 20 | notes = 'Friction is only applied when the motor is disabled.' 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/physics/SphereShape/getRadius.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the radius of the SphereShape.', 3 | description = 'Returns the radius of the SphereShape.', 4 | arguments = {}, 5 | returns = { 6 | radius = { 7 | type = 'number', 8 | description = 'The radius of the sphere, in meters.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'radius' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/physics/SphereShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A sphere Shape.', 3 | description = 'A type of `Shape` that can be used for spheres.', 4 | extends = 'Shape', 5 | constructors = { 6 | 'lovr.physics.newSphereShape', 7 | 'World:newSphereCollider' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/physics/TerrainShape/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A terrain Shape.', 3 | description = 'A type of `Shape` that can be used for terrains and irregular surfaces.', 4 | extends = 'Shape', 5 | constructors = { 6 | 'lovr.physics.newTerrainShape', 7 | 'World:newTerrainCollider' 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /api/lovr/physics/WeldJoint/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'A joint that welds two colliders together.', 3 | description = [[ 4 | A WeldJoint is a `Joint` that restricts all relative motion between two colliders, as though 5 | they were welded together into a single object. All six degrees of freedom are constrained. 6 | 7 | WeldJoints are useful for making breakable objects. Several colliders can be welded together 8 | with joints, and if `Joint:getForce` reports a large enough value, the joints can be disabled or 9 | destroyed, allowing the pieces to move freely. 10 | ]], 11 | extends = 'Joint', 12 | constructors = { 13 | 'lovr.physics.newWeldJoint' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/physics/World/getColliders.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a list of colliders in the World.', 3 | description = [[ 4 | Returns a list of colliders in the world. This includes sleeping and disabled colliders. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | colliders = { 9 | type = 'table', 10 | description = 'The list of `Collider` objects in the World.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'colliders' } 17 | } 18 | }, 19 | related = { 20 | 'World:getColliderCount', 21 | 'World:getJoints' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/World/getJointCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of joints in the world.', 3 | description = [[ 4 | Returns the number of joints in the world. This includes disabled joints. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | count = { 9 | type = 'number', 10 | description = 'The number of joints in the World.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'count' } 17 | } 18 | }, 19 | related = { 20 | 'World:getJoints', 21 | 'World:getColliderCount' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/World/getJoints.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a list of joints in the World.', 3 | description = [[ 4 | Returns a table with all the joints in the World. This includes disabled joints. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | joints = { 9 | type = 'table', 10 | description = 'The list of `Joint` objects in the World.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'joints' } 17 | } 18 | }, 19 | related = { 20 | 'World:getJointCount', 21 | 'World:getColliders' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/physics/World/getStepCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | summary = 'Get the step count of the World.', 4 | description = [[ 5 | Returns the step count of the World. The step count influences how many steps are taken during 6 | a call to `World:update`. A higher number of steps will be slower, but more accurate. The 7 | default step count is 20. 8 | ]], 9 | arguments = {}, 10 | returns = { 11 | steps = { 12 | type = 'number', 13 | description = 'The step count.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = {}, 19 | returns = { 'steps' } 20 | } 21 | }, 22 | related = { 23 | 'World:update' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/physics/World/isDestroyed.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the World has been destroyed.', 3 | description = [[ 4 | Returns whether the World has been destroyed. Destroyed worlds can not be used for anything. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | destroyed = { 9 | type = 'boolean', 10 | description = 'Whether the World has been destroyed.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'destroyed' } 17 | } 18 | }, 19 | related = { 20 | 'World:destroy', 21 | 'Collider:isDestroyed', 22 | 'Shape:isDestroyed', 23 | 'Joint:isDestroyed' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/physics/World/setStepCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | deprecated = true, 3 | summary = 'Set the step count of the World.', 4 | description = [[ 5 | Sets the step count of the World. The step count influences how many steps are taken during a 6 | call to `World:update`. A higher number of steps will be slower, but more accurate. The 7 | default step count is 20. 8 | ]], 9 | arguments = { 10 | steps = { 11 | type = 'number', 12 | description = 'The new step count.' 13 | } 14 | }, 15 | returns = {}, 16 | variants = { 17 | { 18 | arguments = { 'steps' }, 19 | returns = {} 20 | } 21 | }, 22 | related = { 23 | 'World:update' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/system/Permission.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Application permissions.', 3 | description = [[ 4 | These are the different permissions that need to be requested using 5 | `lovr.system.requestPermission` on some platforms. 6 | ]], 7 | values = { 8 | { 9 | name = 'audiocapture', 10 | description = 'Requests microphone access.' 11 | } 12 | }, 13 | related = { 14 | 'lovr.system.requestPermission' 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /api/lovr/system/getClipboardText.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-clipboard', 3 | summary = 'Get the clipboard text.', 4 | description = 'Returns the clipboard text.', 5 | arguments = {}, 6 | returns = { 7 | text = { 8 | type = 'string', 9 | description = 'The clipboard text (may be nil).' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'text' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/system/getCoreCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-info', 3 | summary = 'Get the number of logical cores.', 4 | description = 'Returns the number of logical cores on the system.', 5 | arguments = {}, 6 | returns = { 7 | cores = { 8 | type = 'number', 9 | description = 'The number of logical cores on the system.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'cores' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.thread' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/system/getMouseX.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-mouse', 3 | summary = 'Get the x position of the mouse.', 4 | description = 'Returns the x position of the mouse.', 5 | arguments = {}, 6 | returns = { 7 | x = { 8 | type = 'number', 9 | description = 'The x position of the mouse, relative to the top-left of the window.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'x' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.system.getMouseY', 20 | 'lovr.system.getMousePosition', 21 | 'lovr.mousemoved' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/system/getMouseY.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-mouse', 3 | summary = 'Get the y position of the mouse.', 4 | description = 'Returns the y position of the mouse.', 5 | arguments = {}, 6 | returns = { 7 | y = { 8 | type = 'number', 9 | description = 'The y position of the mouse, relative to the top-left of the window.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'y' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.system.getMouseX', 20 | 'lovr.system.getMousePosition', 21 | 'lovr.mousemoved' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/system/getOS.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-info', 3 | summary = 'Get the current operating system.', 4 | description = 'Returns the current operating system.', 5 | arguments = {}, 6 | returns = { 7 | os = { 8 | type = 'string', 9 | description = 'Either "Windows", "macOS", "Linux", "Android" or "Web".' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'os' } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/system/getWindowHeight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-window', 3 | summary = 'Get the height of the window.', 4 | description = 'Returns the height of the desktop window.', 5 | arguments = {}, 6 | returns = { 7 | width = { 8 | type = 'number', 9 | description = 'The height of the desktop window.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'width' } 16 | } 17 | }, 18 | notes = 'If the window is not open, this will return zero.', 19 | related = { 20 | 'lovr.system.getWindowWidth', 21 | 'lovr.system.getWindowDimensions', 22 | 'lovr.system.isWindowOpen' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/system/getWindowWidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-window', 3 | summary = 'Get the width of the window.', 4 | description = 'Returns the width of the desktop window.', 5 | arguments = {}, 6 | returns = { 7 | width = { 8 | type = 'number', 9 | description = 'The width of the desktop window.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'width' } 16 | } 17 | }, 18 | notes = 'If the window is not open, this will return zero.', 19 | related = { 20 | 'lovr.system.getWindowHeight', 21 | 'lovr.system.getWindowDimensions', 22 | 'lovr.system.isWindowOpen' 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /api/lovr/system/hasKeyRepeat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-keyboard', 3 | summary = 'Check if key repeat is enabled.', 4 | description = 'Returns whether key repeat is enabled.', 5 | arguments = {}, 6 | returns = { 7 | enabled = { 8 | type = 'boolean', 9 | description = 'Whether key repeat is enabled.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'enabled' } 16 | } 17 | }, 18 | notes = 'Key repeat is disabled by default.', 19 | related = { 20 | 'lovr.keypressed' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/system/isWindowFocused.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-window', 3 | summary = 'Check if the desktop window is focused.', 4 | description = 'Returns whether the desktop window is focused.', 5 | arguments = {}, 6 | returns = { 7 | focused = { 8 | type = 'boolean', 9 | description = 'Whether the desktop window is focused.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'focused' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.focus', 20 | 'lovr.headset.isFocused', 21 | 'lovr.system.openWindow', 22 | 'lovr.system.isWindowOpen', 23 | 'lovr.system.isWindowVisible' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/system/isWindowVisible.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-window', 3 | summary = 'Check if the desktop window is visible.', 4 | description = 'Returns whether the desktop window is visible (open and not minimized).', 5 | arguments = {}, 6 | returns = { 7 | visible = { 8 | type = 'boolean', 9 | description = 'Whether the desktop window is visible.' 10 | } 11 | }, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = { 'visible' } 16 | } 17 | }, 18 | related = { 19 | 'lovr.visible', 20 | 'lovr.headset.isVisible', 21 | 'lovr.system.openWindow', 22 | 'lovr.system.isWindowOpen', 23 | 'lovr.system.isWindowFocused' 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/system/pollEvents.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-window', 3 | summary = 'Poll the OS for new window events.', 4 | description = [[ 5 | Fills the event queue with unprocessed events from the operating system. This function should 6 | be called often, otherwise the operating system will consider the application unresponsive. 7 | This function is called in the default implementation of `lovr.run`, and the events are later 8 | processed by `lovr.event.poll`. 9 | ]], 10 | arguments = {}, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = {}, 15 | returns = {} 16 | } 17 | }, 18 | related = { 19 | 'lovr.event.poll' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/system/setClipboardText.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'system-clipboard', 3 | summary = 'Set the clipboard text.', 4 | description = 'Sets the clipboard text.', 5 | arguments = { 6 | text = { 7 | type = 'string', 8 | description = 'The string to set as the clipboard text.' 9 | } 10 | }, 11 | returns = {}, 12 | variants = { 13 | { 14 | arguments = { 'text' }, 15 | returns = {} 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /api/lovr/thread/Channel/clear.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Clear all messages from the Channel.', 3 | description = 'Removes all pending messages from the Channel.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /api/lovr/thread/Channel/getCount.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the number of messages in the Channel.', 3 | description = 'Returns the number of messages in the Channel.', 4 | arguments = {}, 5 | returns = { 6 | count = { 7 | type = 'number', 8 | description = 'The number of messages in the Channel.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'count' } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /api/lovr/thread/Thread/getError.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the Thread\'s error message.', 3 | description = [[ 4 | Returns the message for the error that occurred on the Thread, or nil if no error has occurred. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | error = { 9 | type = 'string', 10 | description = 'The error message, or `nil` if no error has occurred on the Thread.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'error' } 17 | } 18 | }, 19 | related = { 20 | 'lovr.threaderror' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/lovr/thread/Thread/isRunning.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Check if the Thread is running.', 3 | description = 'Returns whether or not the Thread is currently running.', 4 | arguments = {}, 5 | returns = { 6 | running = { 7 | type = 'boolean', 8 | description = 'Whether or not the Thread is running.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'running' } 15 | } 16 | }, 17 | related = { 18 | 'Thread:start' 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/thread/Thread/start.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Start the Thread.', 3 | description = 'Starts the Thread.', 4 | arguments = { 5 | ['...arguments'] = { 6 | type = '*', 7 | description = 'Up to 4 arguments to pass to the Thread\'s function.' 8 | } 9 | }, 10 | returns = {}, 11 | variants = { 12 | { 13 | arguments = { '...arguments' }, 14 | returns = {} 15 | } 16 | }, 17 | notes = 'The arguments can be nil, booleans, numbers, strings, or LÖVR objects.', 18 | example = [=[ 19 | function lovr.load() 20 | lovr.thread.newThread([[ 21 | print(...) 22 | ]]):start(lovr.getVersion()) 23 | end 24 | ]=] 25 | } 26 | -------------------------------------------------------------------------------- /api/lovr/thread/Thread/wait.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Wait for the Thread to complete.', 3 | description = 'Waits for the Thread to complete, then returns.', 4 | arguments = {}, 5 | returns = {}, 6 | variants = { 7 | { 8 | arguments = {}, 9 | returns = {} 10 | } 11 | }, 12 | related = { 13 | 'Thread:isRunning' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api/lovr/thread/getChannel.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get a Channel for communicating between threads.', 3 | description = 'Returns a named Channel for communicating between threads.', 4 | arguments = { 5 | name = { 6 | type = 'string', 7 | description = 'The name of the Channel to get.' 8 | } 9 | }, 10 | returns = { 11 | channel = { 12 | type = 'Channel', 13 | description = 'The Channel with the specified name.' 14 | } 15 | }, 16 | variants = { 17 | { 18 | arguments = { 'name' }, 19 | returns = { 'channel' } 20 | } 21 | }, 22 | related = { 23 | 'Channel', 24 | 'lovr.thread.newChannel' 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/lovr/timer/getAverageDelta.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the average delta over the last second.', 3 | description = 'Returns the average delta over the last second.', 4 | arguments = {}, 5 | returns = { 6 | delta = { 7 | type = 'number', 8 | description = 'The average delta, in seconds.' 9 | } 10 | }, 11 | variants = { 12 | { 13 | arguments = {}, 14 | returns = { 'delta' } 15 | } 16 | }, 17 | related = { 18 | 'lovr.timer.getDelta', 19 | 'lovr.update' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/lovr/timer/getFPS.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the current frames per second.', 3 | description = [[ 4 | Returns the current frames per second, averaged over the last 90 frames. 5 | ]], 6 | arguments = {}, 7 | returns = { 8 | fps = { 9 | type = 'number', 10 | description = 'The current FPS.' 11 | } 12 | }, 13 | variants = { 14 | { 15 | arguments = {}, 16 | returns = { 'fps' } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/lovr/timer/getTime.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Get the current time.', 3 | description = [[ 4 | Returns the time since some time in the past. This can be used to measure the difference 5 | between two points in time. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | time = { 10 | type = 'number', 11 | description = 'The current time, in seconds.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'time' } 18 | } 19 | }, 20 | related = { 21 | 'lovr.headset.getTime' 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /api/lovr/timer/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | tag = 'modules', 3 | summary = 'Exposes a high resolution timer.', 4 | description = [[ 5 | The `lovr.timer` module provides a few functions that deal with time. All times are measured in 6 | seconds. 7 | ]] 8 | } 9 | -------------------------------------------------------------------------------- /api/lovr/timer/sleep.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Go to sleep.', 3 | description = [[ 4 | Sleeps the application for a specified number of seconds. While the game is asleep, no code 5 | will be run, no graphics will be drawn, and the window will be unresponsive. 6 | ]], 7 | arguments = { 8 | duration = { 9 | type = 'number', 10 | description = 'The number of seconds to sleep for.' 11 | } 12 | }, 13 | returns = {}, 14 | variants = { 15 | { 16 | arguments = { 'duration' }, 17 | returns = {} 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/lovr/timer/step.lua: -------------------------------------------------------------------------------- 1 | return { 2 | summary = 'Steps the internal clock.', 3 | description = [[ 4 | Steps the timer, returning the new delta time. This is called automatically in `lovr.run` and 5 | it's used to calculate the new `dt` to pass to `lovr.update`. 6 | ]], 7 | arguments = {}, 8 | returns = { 9 | delta = { 10 | type = 'number', 11 | description = 'The amount of time since the last call to this function, in seconds.' 12 | } 13 | }, 14 | variants = { 15 | { 16 | arguments = {}, 17 | returns = { 'delta' } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/Animation/Playback/main.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Model by StrykerDoesAnimation 3 | https://sketchfab.com/models/e8ca2615b4304c3bacb780b0685d8a05 4 | CC Attribution 5 | ]] 6 | 7 | function lovr.load() 8 | model = lovr.graphics.newModel('scytha/scene.gltf') 9 | end 10 | 11 | function lovr.draw(pass) 12 | model:animate(1, lovr.headset.getTime()) 13 | pass:draw(model, 0, 0, -4, .2) 14 | end 15 | -------------------------------------------------------------------------------- /examples/Animation/Playback/scytha/scene.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Animation/Playback/scytha/scene.bin -------------------------------------------------------------------------------- /examples/Animation/Playback/scytha/textures/mat1.002mat_baseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Animation/Playback/scytha/textures/mat1.002mat_baseColor.png -------------------------------------------------------------------------------- /examples/Animation/Playback/scytha/textures/mat2.005mat_baseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Animation/Playback/scytha/textures/mat2.005mat_baseColor.png -------------------------------------------------------------------------------- /examples/Animation/Playback/scytha/textures/mat3.001mat_baseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Animation/Playback/scytha/textures/mat3.001mat_baseColor.png -------------------------------------------------------------------------------- /examples/Audio/Directivity/sine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Audio/Directivity/sine.wav -------------------------------------------------------------------------------- /examples/Audio/Mute/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | source = lovr.audio.newSource('sine.wav') 3 | source:setLooping(true) 4 | source:play() 5 | muted = false 6 | end 7 | 8 | function lovr.update() 9 | if lovr.headset.wasPressed('left', 'trigger') or lovr.headset.wasPressed('right', 'trigger') then 10 | muted = not muted 11 | lovr.audio.setVolume(muted and 0 or 1) 12 | end 13 | end 14 | 15 | function lovr.draw(pass) 16 | local font = lovr.graphics.getDefaultFont() 17 | pass:text(muted and 'Muted' or 'Unmuted', 0, 1.7, -1, .1) 18 | pass:text('Press trigger to toggle mute', 0, 1.7 - font:getHeight() * .2, -1, .1) 19 | end 20 | -------------------------------------------------------------------------------- /examples/Audio/Mute/sine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Audio/Mute/sine.wav -------------------------------------------------------------------------------- /examples/Audio/Playback/main.lua: -------------------------------------------------------------------------------- 1 | -- Play a continuous sine wav 2 | function lovr.load() 3 | source = lovr.audio.newSource('sine.wav') 4 | source:setLooping(true) 5 | source:play() 6 | end 7 | 8 | -- Oscillate volume 9 | function lovr.update() 10 | local time = lovr.timer.getTime() 11 | local average, spread, speed = .5, .25, 4 12 | local volume = average + math.sin(time * speed) * spread 13 | source:setVolume(volume) 14 | end 15 | -------------------------------------------------------------------------------- /examples/Audio/Playback/sine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Audio/Playback/sine.wav -------------------------------------------------------------------------------- /examples/Audio/Sine_Wave_Generator/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | local length = 1 3 | local rate = 48000 4 | local frames = length * rate 5 | local frequency = 440 6 | local volume = 1.0 7 | 8 | sound = lovr.data.newSound(frames, 'f32', 'stereo', rate) 9 | 10 | local data = {} 11 | for i = 1, frames do 12 | local amplitude = math.sin((i - 1) * frequency / rate * (2 * math.pi)) * volume 13 | data[2 * i - 1] = amplitude 14 | data[2 * i - 0] = amplitude 15 | end 16 | 17 | sound:setFrames(data) 18 | 19 | source = lovr.audio.newSource(sound) 20 | source:setLooping(true) 21 | source:play() 22 | end 23 | -------------------------------------------------------------------------------- /examples/Audio/Spatialization/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | effects = { 'spatialization', 'attenuation' } 3 | source = lovr.audio.newSource('sine.wav', { effects = effects }) 4 | source:setLooping(true) 5 | source:play() 6 | end 7 | 8 | function lovr.update() 9 | lovr.audio.setPose(lovr.headset.getPose()) 10 | 11 | local x = math.sin(lovr.timer.getTime() * 2) 12 | source:setPose(x, 1, -1) 13 | end 14 | 15 | function lovr.draw(pass) 16 | pass:sphere(mat4(source:getPose()):scale(.05)) 17 | end 18 | -------------------------------------------------------------------------------- /examples/Audio/Spatialization/sine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Audio/Spatialization/sine.wav -------------------------------------------------------------------------------- /examples/Effects/Blur/eye-chart-test-vintage-cc0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Blur/eye-chart-test-vintage-cc0.jpg -------------------------------------------------------------------------------- /examples/Effects/Clipping/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | shader = lovr.graphics.newShader([[ 3 | vec4 lovrmain() { 4 | vec3 planePosition = vec3(0, 1.7, 0); 5 | vec3 planeNormal = vec3(0, -1, 0); 6 | 7 | ClipDistance[0] = dot(PositionWorld - planePosition, planeNormal); 8 | 9 | return DefaultPosition; 10 | } 11 | ]], 'normal') 12 | end 13 | 14 | function lovr.draw(pass) 15 | pass:setShader(shader) 16 | pass:monkey(0, 1.7, -1, .5, lovr.timer.getTime(), 1, 1, 0) 17 | end 18 | 19 | -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/negx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/negx.jpg -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/negy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/negy.jpg -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/negz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/negz.jpg -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/posx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/posx.jpg -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/posy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/posy.jpg -------------------------------------------------------------------------------- /examples/Effects/Cubemap_Texturing/posz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Cubemap_Texturing/posz.jpg -------------------------------------------------------------------------------- /examples/Effects/Stencil/conf.lua: -------------------------------------------------------------------------------- 1 | function lovr.conf(t) 2 | -- Request a stencil buffer for this app. 3 | -- Kludge: Only one of these should be needed, depending on driver, 4 | -- but we don't know which driver has been picked yet, so we set both. 5 | t.graphics.stencil = true 6 | t.headset.stencil = true 7 | end 8 | -------------------------------------------------------------------------------- /examples/Effects/Stereo_Image/sbs_left_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Effects/Stereo_Image/sbs_left_right.png -------------------------------------------------------------------------------- /examples/Environment/Grid/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | lovr.graphics.setBackgroundColor(.05, .05, .05) 3 | end 4 | 5 | function lovr.draw(pass) 6 | pass:setColor(.1, .1, .12) 7 | pass:plane(0, 0, 0, 100, 100, -math.pi / 2, 1, 0, 0) 8 | pass:setColor(.2, .2, .2) 9 | pass:plane(0, 1e-5, 0, 100, 100, -math.pi / 2, 1, 0, 0, 'line', 100, 100) 10 | end 11 | -------------------------------------------------------------------------------- /examples/Environment/Mirror/conf.lua: -------------------------------------------------------------------------------- 1 | function lovr.conf(t) 2 | t.graphics.stencil = true 3 | t.headset.stencil = true 4 | end 5 | -------------------------------------------------------------------------------- /examples/Environment/Skybox/main.lua: -------------------------------------------------------------------------------- 1 | -- Texture from Humus (www.humus.name) 2 | 3 | function lovr.load() 4 | cube = lovr.graphics.newTexture({ 5 | left = 'negx.jpg', 6 | right = 'posx.jpg', 7 | top = 'posy.jpg', 8 | bottom = 'negy.jpg', 9 | front = 'negz.jpg', 10 | back = 'posz.jpg' 11 | }) 12 | end 13 | 14 | function lovr.draw(pass) 15 | pass:skybox(cube) 16 | end 17 | -------------------------------------------------------------------------------- /examples/Environment/Skybox/negx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/negx.jpg -------------------------------------------------------------------------------- /examples/Environment/Skybox/negy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/negy.jpg -------------------------------------------------------------------------------- /examples/Environment/Skybox/negz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/negz.jpg -------------------------------------------------------------------------------- /examples/Environment/Skybox/posx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/posx.jpg -------------------------------------------------------------------------------- /examples/Environment/Skybox/posy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/posy.jpg -------------------------------------------------------------------------------- /examples/Environment/Skybox/posz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Skybox/posz.jpg -------------------------------------------------------------------------------- /examples/Environment/Terrain_-_Heightmap/heightmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Terrain_-_Heightmap/heightmap.png -------------------------------------------------------------------------------- /examples/Environment/Triplanar_Mapping/dirt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Triplanar_Mapping/dirt.png -------------------------------------------------------------------------------- /examples/Environment/Triplanar_Mapping/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Triplanar_Mapping/grass.png -------------------------------------------------------------------------------- /examples/Environment/Triplanar_Mapping/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Environment/Triplanar_Mapping/rock.png -------------------------------------------------------------------------------- /examples/Flatscreen/2D_Button/conf.lua: -------------------------------------------------------------------------------- 1 | function lovr.conf(t) 2 | t.modules.headset = false 3 | end 4 | -------------------------------------------------------------------------------- /examples/Flatscreen/FPS_Controls/conf.lua: -------------------------------------------------------------------------------- 1 | function lovr.conf(t) 2 | t.modules.headset = false 3 | t.window.width = 800 4 | t.window.height = 600 5 | end 6 | -------------------------------------------------------------------------------- /examples/Interaction/Controller_Models/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | models = { 3 | left = lovr.headset.newModel('hand/left'), 4 | right = lovr.headset.newModel('hand/right') 5 | } 6 | end 7 | 8 | function lovr.draw(pass) 9 | for hand, model in pairs(models) do 10 | if lovr.headset.isTracked(hand) then 11 | lovr.headset.animate(model) 12 | pass:draw(model, mat4(lovr.headset.getPose(hand))) 13 | end 14 | end 15 | 16 | if not next(models) then 17 | pass:text('No models loaded', 0, 1.7, -1, .1) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /examples/Interaction/Custom_Hand_Rig/left.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Interaction/Custom_Hand_Rig/left.glb -------------------------------------------------------------------------------- /examples/Interaction/Custom_Hand_Rig/right.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Interaction/Custom_Hand_Rig/right.glb -------------------------------------------------------------------------------- /examples/Interaction/Hand_Tracking/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.draw(pass) 2 | for _, hand in ipairs({ 'left', 'right' }) do 3 | for _, joint in ipairs(lovr.headset.getSkeleton(hand) or {}) do 4 | pass:points(unpack(joint, 1, 3)) 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /examples/Interaction/Pointer/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.draw(pass) 2 | for i, hand in ipairs(lovr.headset.getHands()) do 3 | hand = hand .. '/point' 4 | local position = vec3(lovr.headset.getPosition(hand)) 5 | local direction = quat(lovr.headset.getOrientation(hand)):direction() 6 | 7 | pass:setColor(1, 1, 1) 8 | pass:sphere(position, .01) 9 | 10 | pass:setColor(1, 0, 0) 11 | pass:line(position, position + direction * 50) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /examples/Intro/360_Photo/equirectangular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Intro/360_Photo/equirectangular.jpg -------------------------------------------------------------------------------- /examples/Intro/360_Photo/main.lua: -------------------------------------------------------------------------------- 1 | local skybox 2 | 3 | function lovr.load() 4 | skybox = lovr.graphics.newTexture('equirectangular.jpg') 5 | end 6 | 7 | function lovr.draw(pass) 8 | pass:skybox(skybox) 9 | end 10 | -------------------------------------------------------------------------------- /examples/Intro/3D_Model/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | model = lovr.graphics.newModel('suzanne.obj') 3 | end 4 | 5 | function lovr.draw(pass) 6 | pass:setShader('normal') 7 | pass:draw(model, 0, 1.7, -3, 1, lovr.headset.getTime() * .25) 8 | end 9 | -------------------------------------------------------------------------------- /examples/Intro/Custom_Mesh/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.load() 2 | local format = { 3 | { 'VertexPosition', 'vec3' }, 4 | { 'VertexColor', 'vec4' } 5 | } 6 | 7 | mesh = lovr.graphics.newMesh(format, { 8 | { 0, .4, 0 ; 1, 0, 0, 1 }, 9 | { -.5, -.4, 0 ; 0, 1, 0, 1 }, 10 | { .5, -.4, 0 ; 0, 0, 1, 1 } 11 | }) 12 | end 13 | 14 | function lovr.draw(pass) 15 | pass:draw(mesh, 0, 1.7, -1) 16 | end 17 | -------------------------------------------------------------------------------- /examples/Intro/Hello_World/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.draw(pass) 2 | pass:text('hello world', 0, 1.7, -5) 3 | end 4 | -------------------------------------------------------------------------------- /examples/Intro/Spinning_Cube/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.draw(pass) 2 | pass:cube(0, 1.7, -1, .5, lovr.headset.getTime(), 0, 1, 0, 'line') 3 | end 4 | -------------------------------------------------------------------------------- /examples/Intro/Tracked_Hands/main.lua: -------------------------------------------------------------------------------- 1 | function lovr.draw(pass) 2 | for i, hand in ipairs(lovr.headset.getHands()) do 3 | local x, y, z = lovr.headset.getPosition(hand) 4 | pass:sphere(x, y, z, .1) 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/DamagedHelmet.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/DamagedHelmet.glb -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/ibl.ktx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/ibl.ktx -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/nx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/nx.png -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/ny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/ny.png -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/nz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/nz.png -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/px.png -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/py.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/py.png -------------------------------------------------------------------------------- /examples/Lighting/PBR_Materials/skybox/pz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/examples/Lighting/PBR_Materials/skybox/pz.png -------------------------------------------------------------------------------- /guides/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'Getting_Started', 3 | 'Getting_Started_(Quest)', 4 | 'Callbacks_and_Modules', 5 | 'Simple_Lighting', 6 | 'Shaders', 7 | 'Libraries', 8 | 'Plugins', 9 | 'Distribution', 10 | 'Contributing', 11 | 'VS_Code_Setup', 12 | 'Compiling', 13 | 'FAQ', 14 | 'v0.17.0', 15 | 'v0.18.0', 16 | 'v0.19.0' 17 | } 18 | -------------------------------------------------------------------------------- /guides/v0.19.0.md: -------------------------------------------------------------------------------- 1 | v0.19.0 2 | === 3 | 4 | The codename for LÖVR v0.19.0 is TBD. It is currently 5 | not released. 6 | -------------------------------------------------------------------------------- /showcase/Break/break-buzzer.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-buzzer.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-0.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-0.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-1.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-2.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-3.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-4.ogg -------------------------------------------------------------------------------- /showcase/Break/break-bwomp-song-1-split-5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-bwomp-song-1-split-5.ogg -------------------------------------------------------------------------------- /showcase/Break/break-countdown.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bjornbytes/lovr-docs/0d99e0f9f84e46e3d938e7adf897711eb931e000/showcase/Break/break-countdown.ogg -------------------------------------------------------------------------------- /showcase/Break/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | author = { 3 | name = 'Mermaid Heavy Industries', 4 | link = 'https://mermaid.industries' 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /showcase/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'Break' 3 | } 4 | --------------------------------------------------------------------------------