lovr.headset.newModel
EditReturns a new Model for the specified device.
model = lovr.headset.newModel(device, options)
Arguments
Name | Type | Default | Description |
device | Device | 'head' | The device to load a model for. |
options | table | {} | Options for loading the model. |
.animated | boolean | false |
Whether an animatable model should be loaded, for use with lovr.headset.animate .
|
Returns
Name | Type | Description |
model | Model |
The new Model, or nil if a model could not be loaded.
|
Notes
Currently this is only implemented for hand models on the Oculus Quest.
Example
local models = {}
function lovr.draw(pass)
for i, hand in ipairs(lovr.headset.getHands()) do
models[hand] = models[hand] or lovr.headset.newModel(hand)
if models[hand] then
local x, y, z, angle, ax, ay, az = lovr.headset.getPose(hand)
pass:draw(models[hand], x, y, z, 1, angle, ax, ay, az)
end
end
end