Skip to content

Cubic Spline m_coeffs array index out of bounds #9

@anaanook

Description

@anaanook

Maybe I'm an idiot:

struct CubicSpline
{
	vec3 m_points[SPLINE_POINTS];
	vec3 m_coeffs[SPLINE_POINTS-1][4];

This initializes m_coeffs with an array size of [15], with available indexes from 0-14.

 int n = SPLINE_POINTS - 1;

This sets n to 15.

m_coeffs[n,2] =Vector2.Zero;

Can you explain to me why this wouldn't be out of bounds? Am I dumb, or is this wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions