Sign in to follow this  

Constructor + putting into an array

This topic is 672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have such constructor







THullPolygon(float subarea, vec3 cp, vec3 A, vec3 B, vec3 C, vec3 A2, vec3 B2, vec3 C2) : submerged_area(subarea), center_point(cp),
TrisVerts[0](A), TrisVerts[1](B), TrisVerts[2](C), TrisVerts[3](A2), TrisVerts[4](B2), TrisVerts[5](C2)
{
pressure = 0.0;
pressure2 = 0.0;
tris = 2;
}

where 

vec3 TrisVerts[6];

now compiler throws ( expected at



TrisVerts[0](A), TrisVerts[1](B), TrisVerts[2](C), TrisVerts[3](A2), TrisVerts[4](B2), TrisVerts[5](C2)

but when i change that to



ka(A), kb(B), kc(C), ka2(A2), kb2(B2), kc2(C2)

where



vec3 ka, kb, kc;
vec3 ka2, kb2, kc2;

it compiles, so is there a way to initialize an array of do i have to do this by declaring 6 different vars?

Edited by WiredCat

Share this post


Link to post
Share on other sites

This topic is 672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this