Skip to content

Commit

Permalink
(#73) sun_angle -> sun_normal
Browse files Browse the repository at this point in the history
  • Loading branch information
snake-biscuits committed Aug 2, 2023
1 parent ab4b641 commit 7957abe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions bsp_tool/branches/respawn/apex_legends.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,12 @@ class CellAABBNode(base.Struct): # LUMP 119 (0077)
class LevelInfo(base.Struct): # LUMP 123 (007B)
unknown: List[int] # possibly linked to mesh flags in worldspawn?
num_static_props: int # should match len(bsp.GAME_LUMP.sprp.props) [UNTESTED]
sun_angle: List[float] # sun angle vector matching last ShadowEnvironment's light_environment if r2
sun_normal: vector.vec3 # vector matching angles of last indexed light_environment entity
num_entity_models: int # matches num_models in .ent file headers ("ENTITY02 num_models=X")
__slots__ = ["unknown", "num_static_props", "sun_angle", "num_entity_models"]
__slots__ = ["unknown", "num_static_props", "sun_normal", "num_entity_models"]
_format = "5I3fI"
_arrays = {"unknown": 4, "sun_angle": [*"xyz"]}
_arrays = {"unknown": 4, "sun_normal": [*"xyz"]}
_classes = {"sun_normal": vector.vec3}


class MaterialSort(base.Struct): # LUMP 82 (0052)
Expand Down
8 changes: 4 additions & 4 deletions bsp_tool/branches/respawn/titanfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ class LevelInfo(base.Struct): # LUMP 123 (007B)
first_transparent_mesh: int
first_sky_mesh: int
num_static_props: int # len(bsp.GAME_LUMP.sprp.props)
sun_angle: vector.vec3 # represents angle of last light_environment
__slots__ = ["first_decal_mesh", "first_transparent_mesh", "first_sky_mesh", "num_static_props", "sun_angle"]
sun_normal: vector.vec3 # vector matching angles of last indexed light_environment entity
__slots__ = ["first_decal_mesh", "first_transparent_mesh", "first_sky_mesh", "num_static_props", "sun_normal"]
_format = "4I3f"
_arrays = {"sun_angle": [*"xyz"]}
_classes = {"sun_angle": vector.vec3}
_arrays = {"sun_normal": [*"xyz"]}
_classes = {"sun_normal": vector.vec3}


class LightmapHeader(base.MappedArray): # LUMP 83 (0053)
Expand Down
8 changes: 4 additions & 4 deletions bsp_tool/branches/respawn/titanfall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ class ShadowEnvironment(base.Struct):
first_shadow_mesh: int # first ShadowMesh in this ShadowEnvironment
unknown_2: List[int] # likely indices into other lumps (vistree? nodes?) [num_]
num_shadow_meshes: int # number of ShadowMeshes in this ShadowEnvironment after first_shadow_mesh
sun_angle: vector.vec3 # a unit vector indicating the angle of the sun / shadows
__slots__ = ["unknown_1", "first_shadow_mesh", "unknown_2", "num_shadow_meshes", "sun_angle"]
sun_normal: vector.vec3 # represents angle of last light_environment
__slots__ = ["unknown_1", "first_shadow_mesh", "unknown_2", "num_shadow_meshes", "sun_normal"]
_format = "6i3f"
_arrays = {"unknown_1": 2, "unknown_2": 2, "sun_angle": [*"xyz"]}
_classes = {"sun_angle": vector.vec3}
_arrays = {"unknown_1": 2, "unknown_2": 2, "sun_normal": [*"xyz"]}
_classes = {"sun_normal": vector.vec3}


# classes for special lumps, in alphabetical order:
Expand Down
2 changes: 1 addition & 1 deletion bsp_tool/extensions/convert/respawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def titanfall_to_titanfall2(r1_bsp, outdir="./"):
sun_vector = sun_vector.rotate(z=yaw)
shadow_env = r2.ShadowEnvironment(unknown_1=(0, 0), first_shadow_mesh=0,
unknown_2=(1, 0), num_shadow_meshes=len(r1_bsp.SHADOW_MESHES),
angle_vector=sun_vector)
sun_normal=sun_vector)
r1_bsp.SHADOW_ENVIRONMENTS = [shadow_env]
light_env["lightEnvironmentIndex"] = "*0"
# Entities
Expand Down

0 comments on commit 7957abe

Please sign in to comment.