Make mjv_cameraFrame and mjv_cameraFrustum public.

PiperOrigin-RevId: 832187804
Change-Id: I74d05d7fe03bc81bd05a823c7c9791bca12e3079
This commit is contained in:
Haroon Qureshi
2025-11-14 00:02:05 -08:00
committed by Copybara-Service
parent 86ac3a5e28
commit 6c15c711ee
8 changed files with 161 additions and 6 deletions
+2
View File
@@ -740,6 +740,8 @@ PYBIND11_MODULE(_functions, pymodule) {
Def<traits::mjv_makeLights>(pymodule);
Def<traits::mjv_updateCamera>(pymodule);
Def<traits::mjv_updateSkin>(pymodule);
Def<traits::mjv_cameraFrame>(pymodule);
Def<traits::mjv_cameraFrustum>(pymodule);
// UI framework
// Skipped: entire section (can add this if there's demand)
+96
View File
@@ -4929,6 +4929,102 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Update skins.',
)),
('mjv_cameraFrame',
FunctionDecl(
name='mjv_cameraFrame',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='headpos',
type=ArrayType(
inner_type=ValueType(name='mjtNum'),
extents=(3,),
),
nullable=True,
),
FunctionParameterDecl(
name='forward',
type=ArrayType(
inner_type=ValueType(name='mjtNum'),
extents=(3,),
),
nullable=True,
),
FunctionParameterDecl(
name='up',
type=ArrayType(
inner_type=ValueType(name='mjtNum'),
extents=(3,),
),
nullable=True,
),
FunctionParameterDecl(
name='right',
type=ArrayType(
inner_type=ValueType(name='mjtNum'),
extents=(3,),
),
nullable=True,
),
FunctionParameterDecl(
name='d',
type=PointerType(
inner_type=ValueType(name='mjData', is_const=True),
),
),
FunctionParameterDecl(
name='cam',
type=PointerType(
inner_type=ValueType(name='mjvCamera', is_const=True),
),
),
),
doc='Compute camera position and forward, up, and right vectors.',
)),
('mjv_cameraFrustum',
FunctionDecl(
name='mjv_cameraFrustum',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='zver',
type=ArrayType(
inner_type=ValueType(name='float'),
extents=(2,),
),
nullable=True,
),
FunctionParameterDecl(
name='zhor',
type=ArrayType(
inner_type=ValueType(name='float'),
extents=(2,),
),
nullable=True,
),
FunctionParameterDecl(
name='zclip',
type=ArrayType(
inner_type=ValueType(name='float'),
extents=(2,),
),
nullable=True,
),
FunctionParameterDecl(
name='m',
type=PointerType(
inner_type=ValueType(name='mjModel', is_const=True),
),
),
FunctionParameterDecl(
name='cam',
type=PointerType(
inner_type=ValueType(name='mjvCamera', is_const=True),
),
),
),
doc='Compute camera frustum: vertical, horizontal, and clip planes.',
)),
('mjr_defaultContext',
FunctionDecl(
name='mjr_defaultContext',