Skip to content

Commit

Permalink
Fix Quaternion default init (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
tishin authored Jan 6, 2024
1 parent 615e148 commit 372692c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Generator/Generator/BuiltinGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ func generateBuiltinCtors (_ p: Printer,
p ("self.green = 0")
p ("self.blue = 0")
p ("self.alpha = 0")
} else if bc.name == "Quaternion" && m.arguments == nil {
p ("self.x = 0")
p ("self.y = 0")
p ("self.z = 0")
p ("self.w = 1")
} else {
for x in members {
p ("self.\(x.name) = \(MemberBuiltinJsonTypeToSwift(x.type)) ()")
Expand Down

0 comments on commit 372692c

Please sign in to comment.