Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct node
- {
- Vector *controlPoint;
- float time;
- node *next;
- };
- node *firstPoint;
- node *secondPoint;
- node *focusPoint;
- node* addPoint(Vector *point, float time)
- {
- node *temp;
- temp = new node;
- temp->controlPoint = point;
- temp->time = time;
- if (firstPoint == NULL)
- {
- firstPoint = temp;
- firstPoint->next = NULL;
- }
- else
- {
- node *it = firstPoint;
- while (it->next != NULL) {
- it = it->next;
- }
- it->next = temp;
- temp->next = NULL;
- }
- return temp;
- }
- int countPoints() {
- int count = 0;
- if (firstPoint != NULL) {
- ++count;
- node* it = firstPoint;
- while (it->next != NULL) {
- it = it->next;
- ++count;
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement