{"action":"created","issue":{"url":"https://api.github.com/repos/bulletphysics/bullet3/issues/355","labels_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/355/labels{/name}","comments_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/355/comments","events_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/355/events","html_url":"https://github.com/bulletphysics/bullet3/issues/355","id":68083269,"number":355,"title":"Question: array of btTransofrm for adding child shapes","user":{"login":"Ehsanizadi","id":7814193,"avatar_url":"https://avatars.githubusercontent.com/u/7814193?v=3","gravatar_id":"","url":"https://api.github.com/users/Ehsanizadi","html_url":"https://github.com/Ehsanizadi","followers_url":"https://api.github.com/users/Ehsanizadi/followers","following_url":"https://api.github.com/users/Ehsanizadi/following{/other_user}","gists_url":"https://api.github.com/users/Ehsanizadi/gists{/gist_id}","starred_url":"https://api.github.com/users/Ehsanizadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ehsanizadi/subscriptions","organizations_url":"https://api.github.com/users/Ehsanizadi/orgs","repos_url":"https://api.github.com/users/Ehsanizadi/repos","events_url":"https://api.github.com/users/Ehsanizadi/events{/privacy}","received_events_url":"https://api.github.com/users/Ehsanizadi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-13T12:18:45Z","updated_at":"2015-04-13T17:58:59Z","closed_at":null,"body":"Hi,\r\n\r\nI have couple of box shapes and I want to add them to a compound shape.\r\nFor the local transform declaration, it is more convenient in my case to define an array of btTransforms, like this:\r\n```\r\n\r\nbtTransform    localTransofrm[8];\r\nlocalTransform[0].setOrigin(btVector3(bla, bla, bla);\r\n.\r\n.\r\n.\r\nlocalTransofrm[8].setOrigin(btVector3(bla, bla, bla));\r\n\r\nfor (int i=0; i<9; i++){\r\n    compoundObjectShape->addChildShape( localTransform[i], otherShape[i]);\r\n}\r\n```\r\nThis compiles well, however, I get segmentation fault when running the code.\r\n\r\nBut when I declare the localTransform (s) separately, it works well. \r\n\r\nMy question is that is there any sort of limitations for definition of btTransform (s) in the form of arrays?\r\nHere, I just have 9 childShapes which is not hard to separately define them, but what about the case of many childShapes??\r\n(Or perhaps I am mistaking about something?)\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/bulletphysics/bullet3/issues/comments/92445881","html_url":"https://github.com/bulletphysics/bullet3/issues/355#issuecomment-92445881","issue_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/355","id":92445881,"user":{"login":"scpeters","id":3650755,"avatar_url":"https://avatars.githubusercontent.com/u/3650755?v=3","gravatar_id":"","url":"https://api.github.com/users/scpeters","html_url":"https://github.com/scpeters","followers_url":"https://api.github.com/users/scpeters/followers","following_url":"https://api.github.com/users/scpeters/following{/other_user}","gists_url":"https://api.github.com/users/scpeters/gists{/gist_id}","starred_url":"https://api.github.com/users/scpeters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scpeters/subscriptions","organizations_url":"https://api.github.com/users/scpeters/orgs","repos_url":"https://api.github.com/users/scpeters/repos","events_url":"https://api.github.com/users/scpeters/events{/privacy}","received_events_url":"https://api.github.com/users/scpeters/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T17:58:59Z","updated_at":"2015-04-13T17:58:59Z","body":"The seg-faults occur because of accessing beyond the end of the array.\r\n~~~\r\nbtTransform    localTransform[8];\r\n// This is incorrect\r\nlocalTransform[8].setOrigin(btVector3(1, 2, 3));\r\n~~~"}}