> I believe Nim assumes that identifiers starting with a capital letter are 
> types. Use this: 
>     
>     
>     type Camera* = ref object
>       position*,front*,up*,right*,worldUp*:Vec3f
>       yaw*,pitch*,movementSpeed*,mouseSensitivity*,zoom*:float32
>     

Fortunatly Nim isn't Go, you may name your identifiers as you want.

I think your problem is that even in methods, by default, you explicitly have 
to add the this, like so: 
    
    
    method UpdateCameraVectors(this: Camera) {.base.} =
        this.Front.x = cos(radians(this.Yaw)) * cos(radians(this.Pitch))
        this.Front.y = sin(radians(this.Pitch))
        this.Front.z = sin(radians(this.Yaw)) * cos(radians(this.Pitch))
        this.Front = normalize(this.Front);
    

If you add the following: 
    
    
    {.this: this.}
    

at the top of your file, it should work without explicitly stating the this(see 
here: 
[https://nim-lang.org/docs/manual.html#overloading-resolution-automatic-self-insertions](https://nim-lang.org/docs/manual.html#overloading-resolution-automatic-self-insertions))

Reply via email to